Browse Source

Pass properly options in setStyle. Fixes #3176

pull/3264/head
Artur Arseniev 6 years ago
parent
commit
bc0983d8f3
  1. 4
      src/css_composer/index.js
  2. 8
      src/editor/model/Editor.js

4
src/css_composer/index.js

@ -257,8 +257,8 @@ export default () => {
* Remove all rules
* @return {this}
*/
clear() {
this.getAll().reset();
clear(opts = {}) {
this.getAll().reset(null, opts);
return this;
},

8
src/editor/model/Editor.js

@ -453,14 +453,14 @@ export default Backbone.Model.extend({
/**
* Set style inside editor's canvas. This method overrides actual style
* @param {Object|string} style CSS string or style model
* @param {Object} opt the options object to be used by the [CssRules.add]{@link rules#add} method
* @param {Object} opt the options object to be used by the `CssRules.add` method
* @return {this}
* @private
*/
setStyle(style, opt = {}) {
var rules = this.get('CssComposer').getAll();
for (var i = 0, len = rules.length; i < len; i++) rules.pop();
rules.add(style, opt);
const cssc = this.get('CssComposer');
cssc.clear(opt);
cssc.getAll().add(style, opt);
return this;
},

Loading…
Cancel
Save