Browse Source

Make clearProperties configurable

pull/187/head
Artur Arseniev 9 years ago
parent
commit
02f1117272
  1. 3
      src/style_manager/config/config.js
  2. 6
      src/style_manager/view/PropertyView.js

3
src/style_manager/config/config.js

@ -20,6 +20,9 @@ module.exports = {
// is set to false, highlightComputed will not take effect
showComputed: true,
// Adds the possibility to clear property value from the target style
clearProperties: false,
// Properties which are valid to be shown as computed
// (Identified as inherited properties: https://developer.mozilla.org/en-US/docs/Web/CSS/inheritance)
validComputed: ['border-collapse', 'border-spacing', 'caption-side', 'color', 'cursor', 'direction', 'empty-cells',

6
src/style_manager/view/PropertyView.js

@ -54,6 +54,7 @@ module.exports = Backbone.View.extend({
const status = this.model.get('status');
const pfx = this.pfx;
const ppfx = this.ppfx;
const config = this.config;
const updatedCls = `${ppfx}active-color`;
const computedCls = `${ppfx}warn-color`;
const labelEl = this.$el.find(`> .${pfx}label`);
@ -64,7 +65,10 @@ module.exports = Backbone.View.extend({
switch (status) {
case 'updated':
labelEl.addClass(updatedCls);
clearStyle.display = 'inline';
if (config.clearProperties) {
clearStyle.display = 'inline';
}
break;
case 'computed':
labelEl.addClass(computedCls);

Loading…
Cancel
Save