]> git.cworth.org Git - empires-html/commit
Fix the gear toggle to work the first time it is clicked master
authorCarl Worth <cworth@cworth.org>
Tue, 12 May 2020 01:22:04 +0000 (18:22 -0700)
committerCarl Worth <cworth@cworth.org>
Tue, 12 May 2020 01:22:04 +0000 (18:22 -0700)
commitadd3b74cb709a9ad898b3499e148dfbb95f54ddc
treea11aee991fcef78240159b06ef77ad76e67d1238
parent1d72ba34f93cf0c821771bc6697891004abab95b
Fix the gear toggle to work the first time it is clicked

Apparently, the first time this condition is executed, the
host_tools.style.display attribute is not "none" but is instead some
sort of empty value. With the old code, this made a first click on the
gear do nothing, (setting it to "none" but not toggling visibility)
and then a second click would make the host tools appear.

With this change to reverse the logic to look for an explicit value of
"block" (which is set only after the first click) the gear button
works reliably on every click including the first.
empires-client.js