Build 0.3.7.
Showing
4 changed files
with
14 additions
and
6 deletions
1 | // rivets.js | 1 | // rivets.js |
2 | // version: 0.3.6 | 2 | // version: 0.3.7 |
3 | // author: Michael Richards | 3 | // author: Michael Richards |
4 | // license: MIT | 4 | // license: MIT |
5 | (function() { | 5 | (function() { |
... | @@ -91,7 +91,7 @@ | ... | @@ -91,7 +91,7 @@ |
91 | }; | 91 | }; |
92 | 92 | ||
93 | Binding.prototype.bind = function() { | 93 | Binding.prototype.bind = function() { |
94 | var keypath, _i, _len, _ref, _ref1; | 94 | var dependency, keypath, model, _i, _len, _ref, _ref1; |
95 | if (this.options.bypass) { | 95 | if (this.options.bypass) { |
96 | this.sync(); | 96 | this.sync(); |
97 | } else { | 97 | } else { |
... | @@ -103,8 +103,16 @@ | ... | @@ -103,8 +103,16 @@ |
103 | if ((_ref = this.options.dependencies) != null ? _ref.length : void 0) { | 103 | if ((_ref = this.options.dependencies) != null ? _ref.length : void 0) { |
104 | _ref1 = this.options.dependencies; | 104 | _ref1 = this.options.dependencies; |
105 | for (_i = 0, _len = _ref1.length; _i < _len; _i++) { | 105 | for (_i = 0, _len = _ref1.length; _i < _len; _i++) { |
106 | keypath = _ref1[_i]; | 106 | dependency = _ref1[_i]; |
107 | Rivets.config.adapter.subscribe(this.model, keypath, this.sync); | 107 | if (/^\./.test(dependency)) { |
108 | model = this.model; | ||
109 | keypath = dependency.substr(1); | ||
110 | } else { | ||
111 | dependency = dependency.split('.'); | ||
112 | model = this.view.models[dependency.shift()]; | ||
113 | keypath = dependency.join('.'); | ||
114 | } | ||
115 | Rivets.config.adapter.subscribe(model, keypath, this.sync); | ||
108 | } | 116 | } |
109 | } | 117 | } |
110 | if (this.isBidirectional()) { | 118 | if (this.isBidirectional()) { | ... | ... |
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.3.6", | 4 | "version" : "0.3.7", |
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