From b1dd324c0cdb64ad28c4f33ae1d3e4b202dfdf49 Mon Sep 17 00:00:00 2001 From: Timofey Dergachev Date: Sat, 1 Jul 2017 22:54:07 +0300 Subject: [PATCH] Fix classes property --- addon/mixin.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addon/mixin.js b/addon/mixin.js index 33ff73c..6d27486 100644 --- a/addon/mixin.js +++ b/addon/mixin.js @@ -6,6 +6,7 @@ const { mixin, assert, computed, + Object: EmObject, } = Ember; // Imitation private properties @@ -88,12 +89,14 @@ export default Mixin.create({ const id = this.elementId; this.stylesheet.attach(id, componentName); - this.set('classes', this.stylesheet.sheet.classes); + const classes = EmObject.create(this.stylesheet.sheet.classes); const sheet = this.stylesheet.dynamicSheets[id]; const fields = this.get('jssObservedProps') || []; const update = () => sheet.update(this.getProperties(fields)); + this.set('classes', classes); + update(); fields.forEach((field) => this.addObserver(field, this, update)); @@ -103,5 +106,5 @@ export default Mixin.create({ this._super(...arguments); this.stylesheet.detach(this.elementId); - } + }, });