aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2015-08-14 19:42:42 +0100
committerSimon Tatham <anakin@pobox.com>2015-08-14 19:42:42 +0100
commitdd9e24a42fda3a9810ae1e4ce394be1259821fd2 (patch)
tree9f3324722278f790225068bfa45aa009cecfda9f
parentc296301a06ce49b87c954c9d15452521dfeddf1a (diff)
downloadpuzzles-dd9e24a42fda3a9810ae1e4ce394be1259821fd2.zip
puzzles-dd9e24a42fda3a9810ae1e4ce394be1259821fd2.tar.gz
puzzles-dd9e24a42fda3a9810ae1e4ce394be1259821fd2.tar.bz2
puzzles-dd9e24a42fda3a9810ae1e4ce394be1259821fd2.tar.xz
emcc frontend: stop indiscriminately squashing mouseups.
The mouseup listener was calling event.preventDefault(), as part of the mechanism for making mouse clicks and drags on the puzzle's resize handle have resizing effects _instead_ of the normal browser behaviour. However, calling event.preventDefault() on _every_ mouseup, rather than just the ones associated with the resize handle, was overkill, and I've recently noticed that it's breaking attempts to select from the game type dropdown by clicking the mouse. So now I'm only calling preventDefault() on the mouseups that I have reason to think are actually relevant to what I'm trying to do. (I don't know why I've only just noticed this. I suppose a change of behaviour between Firefox versions is the most likely cause.)
-rw-r--r--emccpre.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/emccpre.js b/emccpre.js
index fef83c1..ebf67d1 100644
--- a/emccpre.js
+++ b/emccpre.js
@@ -333,6 +333,7 @@ function initPuzzle() {
resize_xbase = null;
resize_ybase = null;
onscreen_canvas.focus(); // return focus to the puzzle
+ event.preventDefault();
} else if (restore_pending) {
// If you have the puzzle at larger than normal size and
// then right-click to restore, I haven't found any way to
@@ -345,8 +346,8 @@ function initPuzzle() {
restore_puzzle_size();
onscreen_canvas.focus();
}, 20);
+ event.preventDefault();
}
- event.preventDefault();
});
// Run the C setup function, passing argv[1] as the fragment