diff --git a/src/style_manager/view/PropertySliderView.js b/src/style_manager/view/PropertySliderView.js index 9d681b2f6..42decfe6f 100644 --- a/src/style_manager/view/PropertySliderView.js +++ b/src/style_manager/view/PropertySliderView.js @@ -11,13 +11,10 @@ export default Property.extend({ }, templateInput(model) { - const ppfx = this.ppfx; + const { ppfx } = this; return `
- +
`; }, @@ -31,23 +28,17 @@ export default Property.extend({ }, inputValueChanged() { - const model = this.model; - const step = model.get('step'); - this.getInputEl().value = this.getSliderEl().value; - const value = this.getInputValue() - step; - model.set('value', value, { avoidStore: 1 }).set('value', value + step); - this.elementUpdated(); + this.model.upValue(this.getSliderEl().value); }, inputValueChangedSoft() { - this.getInputEl().value = this.getSliderEl().value; - this.model.set('value', this.getInputValue(), { avoidStore: 1 }); - this.elementUpdated(); + this.model.upValue(this.getSliderEl().value, { partial: true }); }, setValue(value) { - const parsed = this.model.parseValue(value); - this.getSliderEl().value = parseFloat(parsed.value); + const { model } = this; + const parsed = model.parseValue(value); + this.getSliderEl().value = value === '' ? model.getDefaultValue() : parseFloat(parsed.value); Property.prototype.setValue.apply(this, arguments); }, diff --git a/src/style_manager/view/PropertyView.js b/src/style_manager/view/PropertyView.js index 194b293d7..6328ce538 100644 --- a/src/style_manager/view/PropertyView.js +++ b/src/style_manager/view/PropertyView.js @@ -25,7 +25,7 @@ export default Backbone.View.extend({ ${label} - ${!parent ? `` : ''} + ${!parent ? `` : ''} `; },