1c10de2b by Michael Richards

Build 0.3.12.

1 parent ec42165d
// rivets.js
// version: 0.3.11
// version: 0.3.12
// author: Michael Richards
// license: MIT
(function() {
......@@ -90,7 +90,7 @@
};
Binding.prototype.bind = function() {
var dependency, keypath, model, _i, _len, _ref, _ref1;
var dependency, keypath, model, _i, _len, _ref, _ref1, _results;
if (this.options.bypass) {
this.sync();
} else {
......@@ -98,9 +98,13 @@
if (Rivets.config.preloadData) {
this.sync();
}
if (this.isBidirectional()) {
bindEvent(this.el, 'change', this.publish);
}
}
if ((_ref = this.options.dependencies) != null ? _ref.length : void 0) {
_ref1 = this.options.dependencies;
_results = [];
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
dependency = _ref1[_i];
if (/^\./.test(dependency)) {
......@@ -111,29 +115,29 @@
model = this.view.models[dependency.shift()];
keypath = dependency.join('.');
}
Rivets.config.adapter.subscribe(model, keypath, this.sync);
_results.push(Rivets.config.adapter.subscribe(model, keypath, this.sync));
}
}
if (this.isBidirectional()) {
return bindEvent(this.el, 'change', this.publish);
return _results;
}
};
Binding.prototype.unbind = function() {
var keypath, _i, _len, _ref, _ref1;
var keypath, _i, _len, _ref, _ref1, _results;
if (!this.options.bypass) {
Rivets.config.adapter.unsubscribe(this.model, this.keypath, this.sync);
if ((_ref = this.options.dependencies) != null ? _ref.length : void 0) {
_ref1 = this.options.dependencies;
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
keypath = _ref1[_i];
Rivets.config.adapter.unsubscribe(this.model, keypath, this.sync);
}
}
if (this.isBidirectional()) {
return this.el.removeEventListener('change', this.publish);
unbindEvent(this.el('change', this.publish));
}
}
if ((_ref = this.options.dependencies) != null ? _ref.length : void 0) {
_ref1 = this.options.dependencies;
_results = [];
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
keypath = _ref1[_i];
_results.push(Rivets.config.adapter.unsubscribe(this.model, keypath, this.sync));
}
return _results;
}
};
return Binding;
......
{
"name" : "rivets",
"description" : "Declarative data binding facility.",
"version" : "0.3.11",
"version" : "0.3.12",
"author" : "Michael Richards",
"url" : "http://rivetsjs.com",
"main" : "./lib/rivets.js",
......
# rivets.js
# version : 0.3.11
# version : 0.3.12
# author : Michael Richards
# license : MIT
......