diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-04-26 20:33:50 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-04-26 20:33:50 -0700 |
commit | 04be4356884eabd94593501e6ba8fae996e1dfab (patch) | |
tree | d81e5d60d30de2c3473686a4a4dda03f457d3cbe /web/static/dartboat.js | |
parent | c497e291847d3ee37caf246d62a788c997166fe5 (diff) | |
download | dartboat-04be4356884eabd94593501e6ba8fae996e1dfab.tar.gz dartboat-04be4356884eabd94593501e6ba8fae996e1dfab.tar.xz |
web: prevent player info boxes flashing on load
Diffstat (limited to 'web/static/dartboat.js')
-rw-r--r-- | web/static/dartboat.js | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/web/static/dartboat.js b/web/static/dartboat.js index 653e0ce..371af93 100644 --- a/web/static/dartboat.js +++ b/web/static/dartboat.js @@ -97,26 +97,22 @@ function setPlayerActive(n) { e.classList[n && e.id == `p${n}-info` ? 'add' : 'remove']('active')); } -function hidePlayerInfo(n) { - let elems = document.getElementById(`p${n}-info`).children; - for (let i = 0; i < elems.length; ++i) - elems[i].style.visibility = 'hidden'; -} - function showPlayerInfo(n) { - let elems = document.getElementById(`p${n}-info`).children; - for (let i = 0; i < elems.length; ++i) - elems[i].style.removeProperty('visibility'); + document.getElementById(`p${n}-info-inner`).style.visibility = 'visible'; } -function updatePlayerRem(n, ptr) { - document.getElementById(`p${n}-rem`).textContent = UTF8ToString(ptr); +function hidePlayerInfo(n) { + document.getElementById(`p${n}-info-inner`).style.visibility = 'hidden'; } function updatePlayerName(n, ptr) { document.getElementById(`p${n}-name`).textContent = UTF8ToString(ptr); } +function updatePlayerRem(n, ptr) { + document.getElementById(`p${n}-rem`).textContent = UTF8ToString(ptr); +} + function updatePlayerSugg(n, ptr) { document.getElementById(`p${n}-sugg`).textContent = UTF8ToString(ptr); } |