[imp] modified on and off

bzr revid: nicolas.vanhoren@openerp.com-20120229110228-15fi6jyj8z51rtmr
This commit is contained in:
niv-openerp
2012-02-29 12:02:28 +01:00
parent 6dcc45a0bb
commit ff248a97cf
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -267,7 +267,7 @@ nova = (function() {
this.__edispatcherEvents = new lib.internal.Events();
this.__edispatcherRegisteredEvents = [];
},
bind: function(events, dest, func) {
on: function(events, dest, func) {
var self = this;
events = events.split(/\s+/);
_.each(events, function(eventName) {
@@ -278,7 +278,7 @@ nova = (function() {
});
return this;
},
unbind: function(events, dest, func) {
off: function(events, dest, func) {
var self = this;
events = events.split(/\s+/);
_.each(events, function(eventName) {
+4 -4
View File
@@ -65,16 +65,16 @@ test("base", function() {
var y = new Claz();
var tmp = 0;
var fct = function() {tmp = 1;};
x.bind("test", y, fct);
x.on("test", y, fct);
equal(tmp, 0);
x.trigger("test");
equal(tmp, 1);
tmp = 0;
x.unbind("test", y, fct);
x.off("test", y, fct);
x.trigger("test");
equal(tmp, 0);
tmp = 0;
x.bind("test", y, fct);
x.on("test", y, fct);
y.destroy();
x.trigger("test");
equal(tmp, 0);
@@ -89,7 +89,7 @@ test("base", function() {
x.set({test: 1});
equal(x.get("test"), 1);
var tmp = 0;
x.bind("change:test", y, function(model, options) {
x.on("change:test", y, function(model, options) {
tmp = 1;
equal(options.oldValue, 1);
equal(options.newValue, 2);