mirror of
https://github.com/placeAtlas/atlas.git
synced 2024-12-29 09:24:45 +01:00
Added timeline slider scroll wheel incrementation
This commit is contained in:
parent
275ac22684
commit
fa725b2d56
2 changed files with 16 additions and 5 deletions
|
@ -321,8 +321,6 @@ async function init() {
|
|||
|
||||
zoom = Math.max(minZoom, Math.min(maxZoom, zoom))
|
||||
applyZoom(x, y, zoom)
|
||||
|
||||
e.preventDefault()
|
||||
}, { passive: true })
|
||||
|
||||
/*function setDesiredZoom(x, y, target){
|
||||
|
|
|
@ -85,8 +85,21 @@ timelineSlider.max = variationsConfig[currentVariation].versions.length - 1
|
|||
timelineSlider.value = currentPeriod
|
||||
timelineList.children[0].value = defaultPeriod
|
||||
|
||||
timelineSlider.addEventListener("input", (event) => {
|
||||
updateTooltip(parseInt(event.target.value), currentVariation)
|
||||
timelineSlider.addEventListener("input", (e) => timelineParser(e.target.value))
|
||||
|
||||
timelineSlider.addEventListener("wheel", function (e) {
|
||||
if (e.deltaY < 0) {
|
||||
this.valueAsNumber += 1;
|
||||
timelineParser(this.value)
|
||||
} else {
|
||||
this.value -= 1;
|
||||
timelineParser(this.value)
|
||||
}
|
||||
e.stopPropagation();
|
||||
}, { passive: true })
|
||||
|
||||
function timelineParser(value) {
|
||||
updateTooltip(parseInt(value), currentVariation)
|
||||
clearTimeout(updateTimeout)
|
||||
updateTimeout = setTimeout(() => {
|
||||
updateTime(parseInt(timelineSlider.value), currentVariation)
|
||||
|
@ -96,7 +109,7 @@ timelineSlider.addEventListener("input", (event) => {
|
|||
}
|
||||
}, 50)
|
||||
}, 25)
|
||||
})
|
||||
}
|
||||
|
||||
variantsEl.addEventListener("input", (event) => {
|
||||
updateTime(-1, event.target.value)
|
||||
|
|
Loading…
Reference in a new issue