Sha256: d0d3abdd7d64ffee5a059638f8abfb8d8b0c0770a27869b35281f7f477ace96c

Contents?: true

Size: 554 Bytes

Versions: 2

Compression:

Stored size: 554 Bytes

Contents

Application.Views.Photos ||= {}

class Application.Views.Photos.UploadIndexView extends Backbone.View
  template: JST["backbone/templates/photos/upload_index"]
  tagName: 'ul'
  className: 'thumbnails'

  initialize: () ->
    @options.photos.bind('reset', @addAll)

  addAll: () =>
    @options.photos.each(@addOne)

  addOne: (photo) =>
    view = new Application.Views.Photos.PhotoView({model : photo})
    @$("#photos").append(view.render().el)

  render: =>
    @$el.html(@template(photos: @options.photos.toJSON() ))
    @addAll()

    return this

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
mix-rails-0.15.0 mix-rails-albums/app/assets/javascripts/backbone/views/photos/upload_index_view.js.coffee
mix-rails-albums-0.15.0 app/assets/javascripts/backbone/views/photos/upload_index_view.js.coffee