Browse Source

Fix active selectors showing

pull/261/head
Artur Arseniev 9 years ago
parent
commit
1cc57b9ed5
  1. 8
      index.html
  2. 6
      src/selector_manager/config/config.js
  3. 4
      src/selector_manager/model/Selectors.js
  4. 2
      src/selector_manager/view/ClassTagView.js
  5. 2
      src/selector_manager/view/ClassTagsView.js

8
index.html

@ -1328,14 +1328,6 @@
//console.log('Style of ', model.get('property'), 'Target: ', targetValue, 'Computed:', computedValue, 'Default:', defaultValue); //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(); editor.render();
</script> </script>
</body> </body>

6
src/selector_manager/config/config.js

@ -28,10 +28,6 @@ module.exports = {
// private: true, // private: true,
// } // }
// }, // },
propertyMap: { propertyMap: {},
'.row, .cell': {
private: true,
}
},
}; };

4
src/selector_manager/model/Selectors.js

@ -7,5 +7,9 @@ module.exports = Backbone.Collection.extend({
getStyleable() { getStyleable() {
return _.filter(this.models, item => return _.filter(this.models, item =>
item.get('active') && !item.get('private')); item.get('active') && !item.get('private'));
},
getValid() {
return _.filter(this.models, item => !item.get('private'));
} }
}); });

2
src/selector_manager/view/ClassTagView.js

@ -129,8 +129,8 @@ module.exports = Backbone.View.extend({
ppfx: this.ppfx, ppfx: this.ppfx,
inputProp: this.inputProp, inputProp: this.inputProp,
})); }));
this.updateStatus();
this.$el.attr('class', this.className); this.$el.attr('class', this.className);
this.updateStatus();
this.updateInputLabel(); this.updateInputLabel();
return this; return this;
}, },

2
src/selector_manager/view/ClassTagsView.js

@ -135,7 +135,7 @@ module.exports = Backbone.View.extend({
if (target) { if (target) {
this.getStates().val(target.get('state')); this.getStates().val(target.get('state'));
validSelectors = target.get('classes').getStyleable(); validSelectors = target.get('classes').getValid();
} }
this.collection.reset(validSelectors); this.collection.reset(validSelectors);

Loading…
Cancel
Save