Build 0.4.1.
Showing
4 changed files
with
15 additions
and
15 deletions
1 | // rivets.js | 1 | // rivets.js |
2 | // version: 0.4.0 | 2 | // version: 0.4.1 |
3 | // author: Michael Richards | 3 | // author: Michael Richards |
4 | // license: MIT | 4 | // license: MIT |
5 | (function() { | 5 | (function() { |
... | @@ -88,12 +88,12 @@ | ... | @@ -88,12 +88,12 @@ |
88 | 88 | ||
89 | Binding.prototype.bind = function() { | 89 | Binding.prototype.bind = function() { |
90 | var dependency, keypath, model, _i, _len, _ref, _ref1, _ref2, _results; | 90 | var dependency, keypath, model, _i, _len, _ref, _ref1, _ref2, _results; |
91 | if ((_ref = this.binder.bind) != null) { | ||
92 | _ref.call(this, this.el); | ||
93 | } | ||
91 | if (this.options.bypass) { | 94 | if (this.options.bypass) { |
92 | this.sync(); | 95 | this.sync(); |
93 | } else { | 96 | } else { |
94 | if ((_ref = this.binder.bind) != null) { | ||
95 | _ref.call(this, this.el); | ||
96 | } | ||
97 | Rivets.config.adapter.subscribe(this.model, this.keypath, this.sync); | 97 | Rivets.config.adapter.subscribe(this.model, this.keypath, this.sync); |
98 | if (Rivets.config.preloadData) { | 98 | if (Rivets.config.preloadData) { |
99 | this.sync(); | 99 | this.sync(); |
... | @@ -120,10 +120,10 @@ | ... | @@ -120,10 +120,10 @@ |
120 | 120 | ||
121 | Binding.prototype.unbind = function() { | 121 | Binding.prototype.unbind = function() { |
122 | var keypath, _i, _len, _ref, _ref1, _ref2, _results; | 122 | var keypath, _i, _len, _ref, _ref1, _ref2, _results; |
123 | if ((_ref = this.binder.unbind) != null) { | ||
124 | _ref.call(this, this.el); | ||
125 | } | ||
123 | if (!this.options.bypass) { | 126 | if (!this.options.bypass) { |
124 | if ((_ref = this.binder.unbind) != null) { | ||
125 | _ref.call(this, this.el); | ||
126 | } | ||
127 | Rivets.config.adapter.unsubscribe(this.model, this.keypath, this.sync); | 127 | Rivets.config.adapter.unsubscribe(this.model, this.keypath, this.sync); |
128 | } | 128 | } |
129 | if ((_ref1 = this.options.dependencies) != null ? _ref1.length : void 0) { | 129 | if ((_ref1 = this.options.dependencies) != null ? _ref1.length : void 0) { |
... | @@ -407,10 +407,10 @@ | ... | @@ -407,10 +407,10 @@ |
407 | checked: { | 407 | checked: { |
408 | publishes: true, | 408 | publishes: true, |
409 | bind: function(el) { | 409 | bind: function(el) { |
410 | return bindEvent(el, 'change', this.publish); | 410 | return this.currentListener = bindEvent(el, 'change', this.publish); |
411 | }, | 411 | }, |
412 | unbind: function(el) { | 412 | unbind: function(el) { |
413 | return unbindEvent(el, 'change', this.publish); | 413 | return unbindEvent(el, 'change', this.currentListener); |
414 | }, | 414 | }, |
415 | routine: function(el, value) { | 415 | routine: function(el, value) { |
416 | if (el.type === 'radio') { | 416 | if (el.type === 'radio') { |
... | @@ -423,10 +423,10 @@ | ... | @@ -423,10 +423,10 @@ |
423 | unchecked: { | 423 | unchecked: { |
424 | publishes: true, | 424 | publishes: true, |
425 | bind: function(el) { | 425 | bind: function(el) { |
426 | return bindEvent(el, 'change', this.publish); | 426 | return this.currentListener = bindEvent(el, 'change', this.publish); |
427 | }, | 427 | }, |
428 | unbind: function(el) { | 428 | unbind: function(el) { |
429 | return unbindEvent(el, 'change', this.publish); | 429 | return unbindEvent(el, 'change', this.currentListener); |
430 | }, | 430 | }, |
431 | routine: function(el, value) { | 431 | routine: function(el, value) { |
432 | if (el.type === 'radio') { | 432 | if (el.type === 'radio') { |
... | @@ -448,10 +448,10 @@ | ... | @@ -448,10 +448,10 @@ |
448 | value: { | 448 | value: { |
449 | publishes: true, | 449 | publishes: true, |
450 | bind: function(el) { | 450 | bind: function(el) { |
451 | return bindEvent(el, 'change', this.publish); | 451 | return this.currentListener = bindEvent(el, 'change', this.publish); |
452 | }, | 452 | }, |
453 | unbind: function(el) { | 453 | unbind: function(el) { |
454 | return unbindEvent(el, 'change', this.publish); | 454 | return unbindEvent(el, 'change', this.currentListener); |
455 | }, | 455 | }, |
456 | routine: function(el, value) { | 456 | routine: function(el, value) { |
457 | var o, _i, _len, _ref, _results; | 457 | var o, _i, _len, _ref, _results; | ... | ... |
This diff is collapsed.
Click to expand it.
1 | { | 1 | { |
2 | "name" : "rivets", | 2 | "name" : "rivets", |
3 | "description" : "Declarative data binding facility.", | 3 | "description" : "Declarative data binding facility.", |
4 | "version" : "0.4.0", | 4 | "version" : "0.4.1", |
5 | "author" : "Michael Richards", | 5 | "author" : "Michael Richards", |
6 | "url" : "http://rivetsjs.com", | 6 | "url" : "http://rivetsjs.com", |
7 | "main" : "./lib/rivets.js", | 7 | "main" : "./lib/rivets.js", | ... | ... |
-
Please register or sign in to post a comment