From 7b61bec50286faf42acbc597e93f79225a1422b4 Mon Sep 17 00:00:00 2001 From: Karolis Narkevicius Date: Tue, 25 Sep 2012 19:52:59 +0100 Subject: [PATCH] Store bindings in each view, instead of a globally shared array --- backbone.stickit.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backbone.stickit.js b/backbone.stickit.js index 1c27d41..f931bbb 100644 --- a/backbone.stickit.js +++ b/backbone.stickit.js @@ -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() { @@ -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.