mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
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.
This commit is contained in:
@ -173,7 +173,7 @@ mergeInto(LibraryManager.library, {
|
||||
} else {
|
||||
seed = UTF8ToString(seed);
|
||||
permalink_seed.href = "#" + seed;
|
||||
permalink_seed.style.display = "inline";
|
||||
permalink_seed.style.display = "";
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -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 = "";
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user