From ec50e048f91165f34a53de2d4b6bd110593ec9a7 Mon Sep 17 00:00:00 2001 From: Edward Loper Date: Sat, 7 Dec 2024 21:49:20 -0500 Subject: [PATCH] try to prevent double tap on hint with stylus from zooming in --- game_fullscreen.html | 10 +++++----- javascript/game.js | 13 ++++--------- style.css | 1 + 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/game_fullscreen.html b/game_fullscreen.html index 90f3921..85e84d8 100644 --- a/game_fullscreen.html +++ b/game_fullscreen.html @@ -4,10 +4,10 @@ Missing Link - - - - + + + + @@ -84,7 +84,7 @@
- Testing 1 + Testing 2
diff --git a/javascript/game.js b/javascript/game.js index 740ea66..61e0292 100644 --- a/javascript/game.js +++ b/javascript/game.js @@ -140,16 +140,11 @@ class Game { }); $("#gameUndo") - .click(e => { this.undo(); e.preventDefault(); }) - .dblclick(e => { e.preventDefault(); }) - .on('pointerdown', e => { e.preventDefault(); }) - .on('stylusdown', e => { e.preventDefault(); }); + .mousedown(e => { this.undo(); e.preventDefault(); }, {passive: false} ) + .on('touchstart', e => { this.undo(); e.preventDefault(); }, {passive: false} ); $("#gameHint") - .click(e => { this.hint(); e.preventDefault(); }, {passive: false} ) - .dblclick(e => { e.preventDefault(); }, {passive: false} ) - .on('touchstart', e => { e.preventDefault(); }, {passive: false} ) - .on('pointerdown', e => { e.preventDefault(); }, {passive: false} ) - .on('stylusdown', e => { e.preventDefault(); }, {passive: false} ); + .mousedown(e => { this.hint(); e.preventDefault(); }, {passive: false} ) + .on('touchstart', e => { this.hint(); e.preventDefault(); }, {passive: false} ); new ToggleButton($("#gameEasyMode"), { label: "Easy Mode", height: 30, width: 80, diff --git a/style.css b/style.css index 7be3f2b..3dc63a0 100644 --- a/style.css +++ b/style.css @@ -24,6 +24,7 @@ border-radius: 8px; display: inline-block; vertical-align: middle; + touch-action: none; } .actionButton img { height: 40px;