mirror of
https://github.com/zombieFox/nightTab.git
synced 2025-02-16 18:20:49 +01:00
improve range control number input action
This commit is contained in:
parent
d5edc010e2
commit
15665b2494
@ -101,13 +101,13 @@ export const Control_color = function({
|
||||
}
|
||||
});
|
||||
|
||||
this.delayedUpdate = null;
|
||||
|
||||
this.update = ({
|
||||
delay = false,
|
||||
all = false
|
||||
} = {}) => {
|
||||
|
||||
let delayedUpdate = null;
|
||||
|
||||
const updateControl = () => {
|
||||
|
||||
this.color.value = convertColor.rgb.hex(get({
|
||||
@ -125,8 +125,8 @@ export const Control_color = function({
|
||||
};
|
||||
|
||||
if (delay) {
|
||||
clearTimeout(delayedUpdate);
|
||||
delayedUpdate = setTimeout(updateControl, 2000);
|
||||
clearTimeout(this.delayedUpdate);
|
||||
this.delayedUpdate = setTimeout(updateControl, 2000);
|
||||
} else {
|
||||
updateControl();
|
||||
};
|
||||
|
@ -194,20 +194,20 @@ export const Control_sliderDouble = function({
|
||||
|
||||
};
|
||||
|
||||
this.delayedUpdate = null;
|
||||
|
||||
this.update = ({
|
||||
delay = false
|
||||
} = {}) => {
|
||||
|
||||
let delayedUpdate = null;
|
||||
|
||||
const updateControl = () => {
|
||||
this.range.left.update();
|
||||
this.range.right.update();
|
||||
};
|
||||
|
||||
if (delay) {
|
||||
clearTimeout(delayedUpdate);
|
||||
delayedUpdate = setTimeout(updateControl, 2000);
|
||||
clearTimeout(this.delayedUpdate);
|
||||
this.delayedUpdate = setTimeout(updateControl, 2000);
|
||||
} else {
|
||||
updateControl();
|
||||
};
|
||||
|
@ -128,20 +128,20 @@ export const Control_sliderSlim = function({
|
||||
}
|
||||
});
|
||||
|
||||
this.delayedUpdate = null;
|
||||
|
||||
this.update = ({
|
||||
delay = false
|
||||
} = {}) => {
|
||||
|
||||
let delayedUpdate = null;
|
||||
|
||||
const updateControl = () => {
|
||||
this.range.value = get({ object: object, path: path });
|
||||
this.number.value = get({ object: object, path: path });
|
||||
};
|
||||
|
||||
if (delay) {
|
||||
clearTimeout(delayedUpdate);
|
||||
delayedUpdate = setTimeout(updateControl, 2000);
|
||||
clearTimeout(this.delayedUpdate);
|
||||
this.delayedUpdate = setTimeout(updateControl, 2000);
|
||||
} else {
|
||||
updateControl();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user