]> git.cworth.org Git - lmno.games/commit
Fix the gear toggle to work the first time it is clicked
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)
commit2ba03213c9f00ac865e80f57dd6eff1fa02f0341
tree9fb6e41ad701529d1ff9c1d6192adb2c57e43001
parent168274653d395d2dfb6885fbb32e081dde8a2127
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/empires-client.js