Skip to content

Commit

Permalink
Merge pull request #8 from KidkArolis/local-model-bindings
Browse files Browse the repository at this point in the history
Store bindings in each view, instead of a globally shared array
  • Loading branch information
delambo committed Sep 25, 2012
2 parents bf95b6c + 7b61bec commit 66ad734
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backbone.stickit.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

// Collection of model event bindings.
// [{model,event,fn}, ...]
_modelBindings: [],
_modelBindings: null,

// Unbind the model bindings that are referenced in `this._modelBindings`.
unstickModel: function() {
Expand All @@ -26,6 +26,8 @@
model = optionalModel || this.model,
bindings = optionalBindingsConfig || this.bindings || {};

this._modelBindings = [];

this.events || (this.events = {});

// Setup a model event binding with the given function, and track the event in this._modelBindings.
Expand Down

0 comments on commit 66ad734

Please sign in to comment.