From 1cc57b9ed5a8a6b47a786aa0d16f91b486eb5ccb Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 18 Aug 2017 03:17:52 +0200 Subject: [PATCH] Fix active selectors showing --- index.html | 8 -------- src/selector_manager/config/config.js | 6 +----- src/selector_manager/model/Selectors.js | 4 ++++ src/selector_manager/view/ClassTagView.js | 2 +- src/selector_manager/view/ClassTagsView.js | 2 +- 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/index.html b/index.html index 95c5d8230..da95cc944 100755 --- a/index.html +++ b/index.html @@ -1328,14 +1328,6 @@ //console.log('Style of ', model.get('property'), 'Target: ', targetValue, 'Computed:', computedValue, 'Default:', defaultValue); }); - editor.on('selector:add', function(model) { - if(model.get('name') == 'row') - console.log('added .row class', model); - - if(model.get('name') == 'cell') - console.log('added .cell class', model); - }); - editor.render(); diff --git a/src/selector_manager/config/config.js b/src/selector_manager/config/config.js index 503c7906e..7de496e4a 100644 --- a/src/selector_manager/config/config.js +++ b/src/selector_manager/config/config.js @@ -28,10 +28,6 @@ module.exports = { // private: true, // } // }, - propertyMap: { - '.row, .cell': { - private: true, - } - }, + propertyMap: {}, }; diff --git a/src/selector_manager/model/Selectors.js b/src/selector_manager/model/Selectors.js index f1f701c3e..42cf33bad 100644 --- a/src/selector_manager/model/Selectors.js +++ b/src/selector_manager/model/Selectors.js @@ -7,5 +7,9 @@ module.exports = Backbone.Collection.extend({ getStyleable() { return _.filter(this.models, item => item.get('active') && !item.get('private')); + }, + + getValid() { + return _.filter(this.models, item => !item.get('private')); } }); diff --git a/src/selector_manager/view/ClassTagView.js b/src/selector_manager/view/ClassTagView.js index 9ce1ee534..825274847 100644 --- a/src/selector_manager/view/ClassTagView.js +++ b/src/selector_manager/view/ClassTagView.js @@ -129,8 +129,8 @@ module.exports = Backbone.View.extend({ ppfx: this.ppfx, inputProp: this.inputProp, })); - this.updateStatus(); this.$el.attr('class', this.className); + this.updateStatus(); this.updateInputLabel(); return this; }, diff --git a/src/selector_manager/view/ClassTagsView.js b/src/selector_manager/view/ClassTagsView.js index 591f91dc5..5a861b928 100644 --- a/src/selector_manager/view/ClassTagsView.js +++ b/src/selector_manager/view/ClassTagsView.js @@ -135,7 +135,7 @@ module.exports = Backbone.View.extend({ if (target) { this.getStates().val(target.get('state')); - validSelectors = target.get('classes').getStyleable(); + validSelectors = target.get('classes').getValid(); } this.collection.reset(validSelectors);