Permalink
Browse files

Remove Backbone bindTo extension.

  • Loading branch information...
1 parent 2837e80 commit de889fe81d6ce78a277f73f6d504dc6f3bf1c4e4 @jimmycuadra committed Jul 16, 2012
@@ -1,12 +0,0 @@
-originalRemove = Backbone.View::remove
-
-Backbone.View::bindTo = (object, args...) ->
- @_bindings ||= []
- @_bindings.push(object: object, args: args)
- object.on.apply(object, args)
-
-Backbone.View::remove = ->
- if @_bindings
- for binding in @_bindings
- binding.object.off.apply(binding.args)
- originalRemove.call(this)
@@ -4,8 +4,8 @@ class MTNT.Views.Entries extends Backbone.View
id: "entries"
initialize: ->
- @bindTo(@collection, "add", @addEntry, this)
- @bindTo(@collection, "reset", @render, this)
+ @collection.bind("add", @addEntry, this)
+ @collection.bind("reset", @render, this)
addEntry: (entry) =>
view = new MTNT.Views.Entry(model: entry)

0 comments on commit de889fe

Please sign in to comment.