summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorniv-openerp <nicolas.vanhoren@openerp.com>2012-02-29 11:28:16 +0100
committerniv-openerp <nicolas.vanhoren@openerp.com>2012-02-29 11:28:16 +0100
commit6dcc45a0bb50435eaf2c64e0fbc8eca4b99bedf3 (patch)
tree9c746018a5bac54cd6fcab8150953b0090133fba /addons
parent63edbe735946bb62db534f2253f69f2e63cd859b (diff)
[imp] changed get and set
bzr revid: nicolas.vanhoren@openerp.com-20120229102816-8wdpo4ybeq5zrsh7
Diffstat (limited to 'addons')
-rw-r--r--addons/web/static/lib/novajs/src/nova.js6
-rw-r--r--addons/web/static/lib/novajs/test/test.js8
2 files changed, 7 insertions, 7 deletions
diff --git a/addons/web/static/lib/novajs/src/nova.js b/addons/web/static/lib/novajs/src/nova.js
index 1c8bd397eb7..c90a1ca2800 100644
--- a/addons/web/static/lib/novajs/src/nova.js
+++ b/addons/web/static/lib/novajs/src/nova.js
@@ -316,12 +316,12 @@ nova = (function() {
_.each(map, function(val, key) {
var tmp = self.__getterSetterInternalMap[key];
self.__getterSetterInternalMap[key] = val;
- self.trigger("changed:" + key, {
+ self.trigger("change:" + key, self, {
oldValue: tmp,
- newValue: val,
- source: self
+ newValue: val
});
});
+ self.trigger("change", self);
},
get: function(key) {
return this.__getterSetterInternalMap[key];
diff --git a/addons/web/static/lib/novajs/test/test.js b/addons/web/static/lib/novajs/test/test.js
index 4ae3418212e..363f2794fb9 100644
--- a/addons/web/static/lib/novajs/test/test.js
+++ b/addons/web/static/lib/novajs/test/test.js
@@ -89,12 +89,12 @@ test("base", function() {
x.set({test: 1});
equal(x.get("test"), 1);
var tmp = 0;
- x.bind("changed:test", y, function(arg) {
+ x.bind("change:test", y, function(model, options) {
tmp = 1;
- equal(arg.oldValue, 1);
- equal(arg.newValue, 2);
+ equal(options.oldValue, 1);
+ equal(options.newValue, 2);
equal(x.get("test"), 2);
- equal(arg.source, x);
+ equal(model, x);
});
x.set({test: 2});
equal(tmp, 1);