[IMP] only trigger change events when a field's value was actually changed, provide more information in change event
bzr revid: xmo@openerp.com-20110819101644-edovs858qrz1wb3y
This commit is contained in:
parent
d69cd3cb15
commit
32e9a10a1e
|
@ -1204,9 +1204,12 @@ var Record = openerp.base.Class.extend(/** @lends Record# */{
|
||||||
* @returns {Record}
|
* @returns {Record}
|
||||||
*/
|
*/
|
||||||
set: function (key, value) {
|
set: function (key, value) {
|
||||||
|
if (this.attributes[key] === value) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
this.attributes[key] = value;
|
this.attributes[key] = value;
|
||||||
this.trigger('change:' + key, this, value);
|
this.trigger('change:' + key, this, value);
|
||||||
this.trigger('change', this);
|
this.trigger('change', this, key, value);
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue