mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
parent
17480a2c80
commit
c7e49d8708
1 changed files with 4 additions and 5 deletions
|
@ -26,12 +26,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
$: if (value) stringValue = value.toFixed(decimalPlaces(step));
|
$: if (value) stringValue = value.toFixed(decimalPlaces(step));
|
||||||
|
|
||||||
function update(this: HTMLInputElement): void {
|
function update(this: HTMLInputElement): void {
|
||||||
value = Math.min(max, Math.max(min, parseFloat(this.value)));
|
const newValue = parseFloat(this.value);
|
||||||
if (value > max) {
|
if (Number.isNaN(newValue)) {
|
||||||
value = max;
|
return;
|
||||||
} else if (value < min) {
|
|
||||||
value = min;
|
|
||||||
}
|
}
|
||||||
|
value = Math.min(max, Math.max(min, newValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleWheel(event: WheelEvent) {
|
function handleWheel(event: WheelEvent) {
|
||||||
|
|
Loading…
Reference in a new issue