Skip to content
Snippets Groups Projects
Commit 7ca77cad authored by Yuriy Maksymets's avatar Yuriy Maksymets Committed by Momo Langenstein
Browse files

Pointer events for undo button

parent 4eac9c63
No related branches found
No related tags found
1 merge request!76Onmouse fix
Pipeline #109308 passed
......@@ -387,15 +387,9 @@ HTML.fastUndoButton.addEventListener("click", () => {
}
})
HTML.undoButton.addEventListener("mouseup", () => {
clearInterval(undoInterval)
})
HTML.undoButton.addEventListener("mouseleave", () => {
clearInterval(undoInterval)
})
const undoButtonEnd = () => clearInterval(undoInterval)
HTML.undoButton.addEventListener("mousedown", () => {
const undoButtonStart = () => {
undoInterval = setInterval(function() {
if (room == null) return
......@@ -406,7 +400,13 @@ HTML.undoButton.addEventListener("mousedown", () => {
HTML.undoButton.classList.add("disabled")
}
}, 1000 / UNDO_RATE)
})
}
HTML.undoButton.addEventListener("pointerup", undoButtonEnd)
HTML.undoButton.addEventListener("pointerleave", undoButtonEnd)
HTML.undoButton.addEventListener("mouseup", undoButtonEnd)
HTML.undoButton.addEventListener("pointerdown", undoButtonStart)
HTML.roomIDElem.addEventListener("keydown", (event) => {
if (event.key == "Enter") {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment