mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
js: If the HTML contains a dialogue-box form, delete it
This is so that (given time for caches to expire) I can switch to having a persistent dialogue box in HTML rather than fabricating it from scratch in JavaScript each time it's used.
This commit is contained in:
@ -190,6 +190,13 @@ function disable_menu_item(item, disabledFlag) {
|
||||
|
||||
// Dialog-box functions called from both C and JS.
|
||||
function dialog_init(titletext) {
|
||||
// Forward compatibility: Delete form and dimmer if they already
|
||||
// exist.
|
||||
dlg_dimmer = document.getElementById("dlgdimmer");
|
||||
if (dlg_dimmer) dlg_dimmer.parentElement.removeChild(dlg_dimmer);
|
||||
dlg_form = document.getElementById("dlgform");
|
||||
if (dlg_form) dlg_form.parentElement.removeChild(dlg_form);
|
||||
|
||||
// Create an overlay on the page which darkens everything
|
||||
// beneath it.
|
||||
dlg_dimmer = document.createElement("div");
|
||||
|
Reference in New Issue
Block a user