From 560fe8f22b35173f43f78cee99f1dfb071ce757d Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 1 Feb 2019 08:54:06 +0100 Subject: [PATCH] Add model and property value to the trigger of `change:attributes:ATTR` --- src/dom_components/model/Component.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dom_components/model/Component.js b/src/dom_components/model/Component.js index 997c69f6a..6ad06b3fa 100644 --- a/src/dom_components/model/Component.js +++ b/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; },