From 21221a29e30745a8ff4981c96e1cd8f9b4fb0308 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 29 Nov 2017 15:45:55 +0100 Subject: [PATCH] Update `clear` in CssComposer, remove also the wrapper style --- src/css_composer/index.js | 4 +--- src/css_composer/view/CssRulesView.js | 8 +++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/css_composer/index.js b/src/css_composer/index.js index e1c1177f5..ebd8a762e 100644 --- a/src/css_composer/index.js +++ b/src/css_composer/index.js @@ -240,10 +240,8 @@ module.exports = () => { * @return {this} */ clear() { - console.log('Before', em.get('DomComponents').getWrapper().getStyle()); - em && em.get('DomComponents').getWrapper().setStyle(''); this.getAll().reset(); - console.log('After', em.get('DomComponents').getWrapper().getStyle()); + em && em.get('DomComponents').getWrapper().setStyle(''); return this; }, diff --git a/src/css_composer/view/CssRulesView.js b/src/css_composer/view/CssRulesView.js index 420350278..94ed5905b 100644 --- a/src/css_composer/view/CssRulesView.js +++ b/src/css_composer/view/CssRulesView.js @@ -4,8 +4,10 @@ var CssRuleView = require('./CssRuleView'); module.exports = Backbone.View.extend({ initialize(o) { - this.config = o.config || {}; - this.pfx = this.config.stylePrefix || ''; + const config = o.config || {}; + this.config = config; + this.em = config.em; + this.pfx = config.stylePrefix || ''; this.className = this.pfx + 'rules'; const coll = this.collection; this.listenTo(coll, 'add', this.addTo ); @@ -51,7 +53,7 @@ module.exports = Backbone.View.extend({ const frag = document.createDocumentFragment(); $el.empty(); this.collection.each(model => this.addToCollection(model, frag)); - $el.append(fragment); + $el.append(frag); $el.attr('class', this.className); return this; }