fix up collection view
This commit is contained in:
parent
d7a77e672b
commit
755ffdb6c0
|
@ -4,8 +4,8 @@ Backbone.Collection.prototype.ensureFetched = (callback) ->
|
|||
this.unbind('refresh', _refresher)
|
||||
callback.apply(this)
|
||||
@_alreadyEnsureFetched = true
|
||||
@bind('refresh', _refresher)
|
||||
@fetch()
|
||||
this.bind('refresh', _refresher)
|
||||
this.fetch()
|
||||
else
|
||||
callback.apply(this)
|
||||
|
||||
|
|
|
@ -4,10 +4,7 @@ class window.<%= plural_object_name %>View extends Backbone.View
|
|||
}
|
||||
template: JST['<%= plural_underscore_name %>/list']
|
||||
initialize: ->
|
||||
@collection.bind('refresh', @addAll)
|
||||
|
||||
this.render()
|
||||
@collection.fetch
|
||||
@collection.bind('refresh', this.addAll)
|
||||
render: =>
|
||||
$(this.el).html(this.template())
|
||||
this
|
||||
|
|
Loading…
Reference in New Issue