Fix regression when seeking with wheel not working

This commit is contained in:
Hans5958 2023-04-07 23:01:51 +07:00
parent be34ca9b25
commit 3601e1db36

View file

@ -42,14 +42,10 @@ timelineList.children[0].value = defaultPeriod
timelineSlider.addEventListener("input", e => timelineParser(e.target.value)) timelineSlider.addEventListener("input", e => timelineParser(e.target.value))
timelineSlider.addEventListener("wheel", e => { timelineSlider.addEventListener("wheel", e => {
if (e.deltaY < 0) { if (e.deltaY < 0) e.target.valueAsNumber += 1
this.valueAsNumber += 1; else e.target.value -= 1
timelineParser(this.value) timelineParser(e.target.value)
} else { e.stopPropagation()
this.value -= 1;
timelineParser(this.value)
}
e.stopPropagation();
}, { passive: true }) }, { passive: true })
function timelineParser(value) { function timelineParser(value) {