aboutsummaryrefslogtreecommitdiff
path: root/emccpre.js
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2013-04-05 15:49:29 +0000
committerSimon Tatham <anakin@pobox.com>2013-04-05 15:49:29 +0000
commit36f35f5db81d95c3fc038f27ac791a2f4f748c10 (patch)
treee15c262299b537d08308b3e39ac2c2e251acb310 /emccpre.js
parent2360b77812e184902e44c7f4ea2f6fc79729e370 (diff)
downloadpuzzles-36f35f5db81d95c3fc038f27ac791a2f4f748c10.zip
puzzles-36f35f5db81d95c3fc038f27ac791a2f4f748c10.tar.gz
puzzles-36f35f5db81d95c3fc038f27ac791a2f4f748c10.tar.bz2
puzzles-36f35f5db81d95c3fc038f27ac791a2f4f748c10.tar.xz
Regretfully remove my trickery with a hidden <option> element inside
the game-type <select>, since IE turns out to ignore display:none on options. Oh well. Instead I now do a more transparent thing: when custom game params are in use, there's a "Custom" option selected in the dropdown, and a separate 'Re-customise' option which brings the config box back up. When an ordinary preset is selected, the Custom option is missing, and there's just a 'Customise'. In the process I've tinkered a bit to arrange that the custom 'preset' is always represented by a negative number rather than one past the last real preset; that seems more consistent overall. [originally from svn r9811]
Diffstat (limited to 'emccpre.js')
-rw-r--r--emccpre.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/emccpre.js b/emccpre.js
index 701c7f7..4ce2209 100644
--- a/emccpre.js
+++ b/emccpre.js
@@ -83,13 +83,18 @@ var dlg_return_sval, dlg_return_ival;
// 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.
+// gametypethiscustom is an option which indicates some custom game
+// params you've already set up, and which will be auto-selected on
+// return from the customisation dialog; gametypenewcustom is an
+// option which you select to indicate that you want to bring up the
+// customisation dialog and select a new configuration. Ideally I'd do
+// this with just one option serving both purposes, but instead we
+// have to do this a bit oddly because browsers don't send 'onchange'
+// events for a select element if you reselect the same one - so if
+// you've picked a custom setup and now want to change it, you need a
+// way to specify that.
var gametypeselector = null, gametypeoptions = [];
-var gametypehiddencustom = null;
+var gametypethiscustom = null, gametypehiddencustom = null;
// The two anchors used to give permalinks to the current puzzle. Used
// by js_update_permalinks().