Skip to content

Commit

Permalink
touch was not working, trying again
Browse files Browse the repository at this point in the history
  • Loading branch information
RusFortunat committed Nov 15, 2024
1 parent bd81c79 commit b9285dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/resources/templates/main-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ <h3>Draw your number here</h3>
document.addEventListener('mousemove', draw);
document.addEventListener('mousedown', setPosition);
document.addEventListener('mouseenter', setPosition);
// for mobile
document.addEventListener('touchend', draw);
document.addEventListener('touchend', setPosition);
document.addEventListener('touchend', setPosition);

// new position from mouse event
function setPosition(e) {
Expand Down

0 comments on commit b9285dc

Please sign in to comment.