aboutsummaryrefslogtreecommitdiff
path: root/emccpre.js
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2013-03-31 09:58:46 +0000
committerSimon Tatham <anakin@pobox.com>2013-03-31 09:58:46 +0000
commit9826ecd5c3b79320823cd762880c302253e88d06 (patch)
treed53a14bbbb435767cdf8be49feead9f5d1c28f1e /emccpre.js
parent3e39f6b80b2b6e4308e2d3a9fa436cbbb9d9b621 (diff)
downloadpuzzles-9826ecd5c3b79320823cd762880c302253e88d06.zip
puzzles-9826ecd5c3b79320823cd762880c302253e88d06.tar.gz
puzzles-9826ecd5c3b79320823cd762880c302253e88d06.tar.bz2
puzzles-9826ecd5c3b79320823cd762880c302253e88d06.tar.xz
Apply a bodge to arrange that if the user selects Custom from the game
type dropdown, we still get an 'onchange' event if they select it a second time. Normally this wouldn't happen, because onchange means what it says and we only get it if a _different_ element is selected. My solution is to create two list items called Custom, set one of them as display:none to stop it showing up when the list is dropped down, and to select it after the configuration box closes. [originally from svn r9788]
Diffstat (limited to 'emccpre.js')
-rw-r--r--emccpre.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/emccpre.js b/emccpre.js
index 548e2a5..ea20771 100644
--- a/emccpre.js
+++ b/emccpre.js
@@ -78,7 +78,14 @@ var dlg_return_sval, dlg_return_ival;
// The <select> object implementing the game-type drop-down, and a
// list of the <option> objects inside it. Used by js_add_preset(),
// js_get_selected_preset() and js_select_preset().
+//
+// gametypehiddencustom is a second copy of the 'Custom' dropdown
+// element, set to display:none. This is used by a bodge in emcclib.js
+// (see comment in js_add_preset) to arrange that if the Custom
+// element is (apparently) already selected, we still find out if the
+// user selects it again.
var gametypeselector = null, gametypeoptions = [];
+var gametypehiddencustom = null;
// The two anchors used to give permalinks to the current puzzle. Used
// by js_update_permalinks().