Browse Source

Add model and property value to the trigger of `change:attributes:ATTR`

pull/1800/head
Artur Arseniev 8 years ago
parent
commit
560fe8f22b
  1. 4
      src/dom_components/model/Component.js

4
src/dom_components/model/Component.js

@ -310,7 +310,9 @@ const Component = Backbone.Model.extend(Styleable).extend(
this.set('attributes', attrs, opts);
const attrPrev = { ...this.previous('attributes') };
const diff = shallowDiff(attrPrev, attrs);
keys(diff).forEach(pr => this.trigger(`change:attributes:${pr}`));
keys(diff).forEach(pr =>
this.trigger(`change:attributes:${pr}`, this, diff[pr])
);
return this;
},

Loading…
Cancel
Save