f6c70967 by Michael Richards

Build 0.3.9.

1 parent d9641ee9
// rivets.js
// version: 0.3.8
// version: 0.3.9
// author: Michael Richards
// license: MIT
(function() {
......@@ -73,8 +73,7 @@
Binding.prototype.set = function(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;
return this.currentListener = this.routine(this.el, this.model, value, this.currentListener);
} else if (this.options.special === 'iteration') {
return this.routine(this.el, value, this);
} else {
......@@ -344,20 +343,25 @@
})();
bindEvent = function(el, event, fn) {
bindEvent = function(el, event, handler, context) {
var fn;
fn = function(e) {
return handler.call(context, e);
};
if (window.jQuery != null) {
el = jQuery(el);
if (el.on != null) {
return el.on(event, fn);
el.on(event, fn);
} else {
return el.bind(event, fn);
el.bind(event, fn);
}
} else if (window.addEventListener != null) {
return el.addEventListener(event, fn, false);
el.addEventListener(event, fn, false);
} else {
event = 'on' + event;
return el.attachEvent(event, fn);
el.attachEvent(event, fn);
}
return fn;
};
unbindEvent = function(el, event, fn) {
......@@ -386,13 +390,11 @@
};
eventBinding = function(event) {
return function(el, bind, unbind) {
if (bind) {
bindEvent(el, event, bind);
}
return function(el, context, bind, unbind) {
if (unbind) {
return unbindEvent(el, event, unbind);
unbindEvent(el, event, unbind);
}
return bindEvent(el, event, bind, context);
};
};
......
{
"name" : "rivets",
"description" : "Declarative data binding facility.",
"version" : "0.3.8",
"version" : "0.3.9",
"author" : "Michael Richards",
"url" : "http://rivetsjs.com",
"main" : "./lib/rivets.js",
......
# rivets.js
# version : 0.3.8
# version : 0.3.9
# author : Michael Richards
# license : MIT
......