diff --git a/js/usercss.js b/js/usercss.js index c57eb8e9..aef83144 100644 --- a/js/usercss.js +++ b/js/usercss.js @@ -224,7 +224,7 @@ var usercss = (() => { state.errorPrefix = ''; // [default, start, end, step, units] (start, end, step & units are optional) if (Array.isArray(state.value) && state.value.length) { - result.default = state.value.shift(); + result.default = parseFloat(state.value.shift()); const nonDigit = /[^\d.+-]/; // label may be placed anywhere after default value const labelIndex = state.value.findIndex(item => nonDigit.test(item)); diff --git a/manage/config-dialog.js b/manage/config-dialog.js index 196f6313..ae920966 100644 --- a/manage/config-dialog.js +++ b/manage/config-dialog.js @@ -314,12 +314,13 @@ function configDialog(style) { } function updateVarOnChange() { - this.va.value = this.type !== 'checkbox' ? this.value : this.checked ? '1' : '0'; if (this.type === 'number') { this.value = this.va.value = clampValue(this.value, this.va.range); - } - if (this.type === 'range') { + } else if (this.type === 'range') { $('.current-value', this.closest('.config-range')).textContent = this.va.value + (this.va.units || ''); + this.va.value = parseFloat(this.value); + } else { + this.va.value = this.type !== 'checkbox' ? this.value : this.checked ? '1' : '0'; } }