Update current value in updateRangeCurrentValue
This commit is contained in:
parent
ec16a0c1e0
commit
a0ffdb7645
|
@ -314,7 +314,7 @@ function configDialog(style) {
|
||||||
function updateVarOnChange() {
|
function updateVarOnChange() {
|
||||||
if (this.type === 'range') {
|
if (this.type === 'range') {
|
||||||
this.va.value = Number(this.value);
|
this.va.value = Number(this.value);
|
||||||
$('.current-value', this.closest('.config-range')).textContent = this.va.value + (this.va.units || '');
|
updateRangeCurrentValue(va, this.va.value);
|
||||||
} else if (this.type === 'number') {
|
} else if (this.type === 'number') {
|
||||||
const value = Number(this.value);
|
const value = Number(this.value);
|
||||||
if (clampValue(value, this.va) === value) {
|
if (clampValue(value, this.va) === value) {
|
||||||
|
@ -342,6 +342,13 @@ function configDialog(style) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateRangeCurrentValue(va, value) {
|
||||||
|
const span = $('.current-value', va.input.closest('.config-range'));
|
||||||
|
if (span) {
|
||||||
|
span.textContent = value + (va.units || '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function updateVarOnInput(event, debounced = false) {
|
function updateVarOnInput(event, debounced = false) {
|
||||||
if (debounced) {
|
if (debounced) {
|
||||||
event.target.dispatchEvent(new Event('change', {bubbles: true}));
|
event.target.dispatchEvent(new Event('change', {bubbles: true}));
|
||||||
|
@ -365,11 +372,8 @@ function configDialog(style) {
|
||||||
} else if (va.type === 'checkbox') {
|
} else if (va.type === 'checkbox') {
|
||||||
va.input.checked = Number(value);
|
va.input.checked = Number(value);
|
||||||
} else if (va.type === 'range') {
|
} else if (va.type === 'range') {
|
||||||
const span = $('.current-value', va.input.closest('.config-range'));
|
|
||||||
va.input.value = value;
|
va.input.value = value;
|
||||||
if (span) {
|
updateRangeCurrentValue(va, va.input.value);
|
||||||
span.textContent = value + (va.units || '');
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
va.input.value = value;
|
va.input.value = value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user