Browse Source

Clear cached stuff in property view

pull/1446/head
Artur Arseniev 8 years ago
parent
commit
3c95de9683
  1. 7
      src/style_manager/view/PropertyCompositeView.js
  2. 6
      src/style_manager/view/PropertyFileView.js
  3. 5
      src/style_manager/view/PropertySliderView.js
  4. 7
      src/style_manager/view/PropertyView.js

7
src/style_manager/view/PropertyCompositeView.js

@ -123,5 +123,12 @@ module.exports = PropertyView.extend({
} }
return value; return value;
},
clearCached() {
PropertyView.prototype.clearCached.apply(this, arguments);
this.$input = null;
this.props = null;
this.$props = null;
} }
}); });

6
src/style_manager/view/PropertyFileView.js

@ -51,6 +51,12 @@ module.exports = PropertyView.extend({
this.setValue(this.componentValue, 0); this.setValue(this.componentValue, 0);
}, },
clearCached() {
PropertyView.prototype.clearCached.apply(this, arguments);
this.$preview = null;
this.$previewBox = null;
},
setValue(value, f) { setValue(value, f) {
PropertyView.prototype.setValue.apply(this, arguments); PropertyView.prototype.setValue.apply(this, arguments);
this.setPreviewView(value && value != this.model.getDefaultValue()); this.setPreviewView(value && value != this.model.getDefaultValue());

5
src/style_manager/view/PropertySliderView.js

@ -56,5 +56,10 @@ module.exports = Property.extend({
if (!this.model.get('showInput')) { if (!this.model.get('showInput')) {
this.inputInst.el.style.display = 'none'; this.inputInst.el.style.display = 'none';
} }
},
clearCached() {
Property.prototype.clearCached.apply(this, arguments);
this.slider = null;
} }
}); });

7
src/style_manager/view/PropertyView.js

@ -473,7 +473,14 @@ module.exports = Backbone.View.extend({
this.setValue(''); this.setValue('');
}, },
clearCached() {
this.clearEl = null;
this.input = null;
this.$input = null;
},
render() { render() {
this.clearCached();
const pfx = this.pfx; const pfx = this.pfx;
const model = this.model; const model = this.model;
const el = this.el; const el = this.el;

Loading…
Cancel
Save