class Pettanr.View.Credits extends Pettanr.View tagName: 'div' className: 'credits' constructor: (@parent, options) -> super(options) initialize: (@options) -> @licensed_pictures = {} render: () -> this.$el.html('') this push: (retrievers) -> _.each retrievers, (retriever, pid) => Pettanr.Picture.retrieve(pid, this, { success: (picture) => pid = picture.get('id') return if @licensed_pictures[pid] @licensed_pictures[pid] = picture credit = new Pettanr.View.Credit(picture, @options) @listenTo(credit, 'click:icon', @click_credit_icon) this.$el.append(credit.render().el) fail: (response, opt) => @open_error_dialog(response, opt) }) click_credit_icon: (item) -> @trigger('click:credit:icon', item)