e0b6c36b by Michael Richards

Build 0.3.5.

1 parent cebdbf06
// rivets.js
// version: 0.3.4
// version: 0.3.5
// author: Michael Richards
// license: MIT
(function() {
......@@ -64,16 +64,13 @@
};
Binding.prototype.set = function(value) {
value = this.formattedValue(value);
value = value instanceof Function && this.options.special !== "event" ? this.formattedValue(value.call(this.model)) : this.formattedValue(value);
if (this.options.special === "event") {
this.routine(this.el, value, this.currentListener);
return this.currentListener = value;
} else if (this.options.special === "iteration") {
return this.routine(this.el, value, this);
} else {
if (value instanceof Function) {
value = value.call(this.model);
}
return this.routine(this.el, value);
}
};
......@@ -294,7 +291,14 @@
})();
bindEvent = function(el, event, fn) {
if (window.addEventListener) {
if (window.jQuery != null) {
el = jQuery(el);
if (el.on != null) {
return el.on(event, fn);
} else {
return el.bind(event, fn);
}
} else if (window.addEventListener != null) {
return el.addEventListener(event, fn, false);
} else {
event = "on" + event;
......@@ -303,7 +307,14 @@
};
unbindEvent = function(el, event, fn) {
if (window.removeEventListener) {
if (window.jQuery != null) {
el = jQuery(el);
if (el.off != null) {
return el.off(event, fn);
} else {
return el.unbind(event, fn);
}
} else if (window.removeEventListener) {
return el.removeEventListener(event, fn, false);
} else {
event = "on" + event;
......
{
"name" : "rivets",
"description" : "Declarative data binding facility.",
"version" : "0.3.4",
"version" : "0.3.5",
"author" : "Michael Richards",
"url" : "http://rivetsjs.com",
"main" : "./lib/rivets.js",
......
# rivets.js
# version : 0.3.4
# version : 0.3.5
# author : Michael Richards
# license : MIT
......