diff --git a/src/dom_components/model/Component.js b/src/dom_components/model/Component.js index 27d54e0cb..f5615d398 100644 --- a/src/dom_components/model/Component.js +++ b/src/dom_components/model/Component.js @@ -373,6 +373,7 @@ const Component = Backbone.Model.extend(Styleable).extend( /** * Update attributes of the component * @param {Object} attrs Key value attributes + * @param {Object} options Options for the model update * @return {this} * @example * component.setAttributes({ id: 'test', 'data-key': 'value' }); @@ -385,13 +386,14 @@ const Component = Backbone.Model.extend(Styleable).extend( /** * Add attributes to the component * @param {Object} attrs Key value attributes + * @param {Object} options Options for the model update * @return {this} * @example * component.addAttributes({ 'data-key': 'value' }); */ - addAttributes(attrs) { + addAttributes(attrs, opts = {}) { const newAttrs = { ...this.getAttributes(), ...attrs }; - this.setAttributes(newAttrs); + this.setAttributes(newAttrs, opts); return this; },