aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2022-10-17 23:11:48 +0100
committerBen Harris <bjh21@bjh21.me.uk>2022-10-17 23:17:59 +0100
commit5c180cfa6fee3409d60d959adacc0701d16c0e26 (patch)
tree13c7448c8d10ff3bdf5aa42ac4ac24ede8f2b69b
parent3c3d8aff2229be103c340c9c2e235c33127556fe (diff)
downloadpuzzles-5c180cfa6fee3409d60d959adacc0701d16c0e26.zip
puzzles-5c180cfa6fee3409d60d959adacc0701d16c0e26.tar.gz
puzzles-5c180cfa6fee3409d60d959adacc0701d16c0e26.tar.bz2
puzzles-5c180cfa6fee3409d60d959adacc0701d16c0e26.tar.xz
js: When making a hidden element visible, just remove "display: none"
This removes any assumption in the JavaScript code about precisely what "display" setting the element should have. This means that now the only places where the JavaScript manipulates elements' styles are to set the width of the puzzle container and to mark and unmark elements with "display: none". These both seem like reasonable kinds of semantic markup that just happen to be expressed as styles.
-rw-r--r--emcclib.js2
-rw-r--r--emccpre.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/emcclib.js b/emcclib.js
index 07f5f40..1cd83d0 100644
--- a/emcclib.js
+++ b/emcclib.js
@@ -173,7 +173,7 @@ mergeInto(LibraryManager.library, {
} else {
seed = UTF8ToString(seed);
permalink_seed.href = "#" + seed;
- permalink_seed.style.display = "inline";
+ permalink_seed.style.display = "";
}
},
diff --git a/emccpre.js b/emccpre.js
index 31ddc71..a175b30 100644
--- a/emccpre.js
+++ b/emccpre.js
@@ -522,6 +522,6 @@ function initPuzzle() {
// it's probably safe to hide the 'sorry, no puzzle here' div and
// show the div containing the actual puzzle.
document.getElementById("apology").style.display = "none";
- document.getElementById("puzzle").style.display = "inline";
+ document.getElementById("puzzle").style.display = "";
};
}