diff options
author | Kyle Gunger <corechg@gmail.com> | 2020-05-17 13:15:41 -0400 |
---|---|---|
committer | Kyle Gunger <corechg@gmail.com> | 2020-05-17 13:15:41 -0400 |
commit | b48f0adccb11619680a47cac5fa9c68f638bd489 (patch) | |
tree | 9e75612c21ae9944b354afa13e2e94834e020e9c /webcards/scripts/gui/lobby.js | |
parent | c9e2eee382df60bc7a058b56c804258848477d67 (diff) |
[WebCards] Update from my local repos
Diffstat (limited to 'webcards/scripts/gui/lobby.js')
-rw-r--r-- | webcards/scripts/gui/lobby.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/webcards/scripts/gui/lobby.js b/webcards/scripts/gui/lobby.js index 731d9ec..07f8223 100644 --- a/webcards/scripts/gui/lobby.js +++ b/webcards/scripts/gui/lobby.js @@ -131,11 +131,12 @@ Lobby.prototype = { }, // Called when the WebSocket state has changed. - setState: function(text, color, server) { - this.e.status.style.backgroundColor = color; - this.e.status.innerText = text; + setState: function(text, s, server) { + this.e.status.setAttribute("s", s); + if(this.e.status.innerText != "Error" || ( this.e.status.innerText == "Error" && text != "Closed")) + this.e.status.innerText = text; this.e.addr.innerText = server; - this.top.setColor(color); + this.top.setStatus(s); }, // Called when we are resetting the game. @@ -144,7 +145,7 @@ Lobby.prototype = { this.e.games.removeChild(this.e.games.firstElementChild) } - this.setState("Connecting", "#DA0", this.e.addr.innerText); + this.setState("Connecting", "loading", this.e.addr.innerText); this.init = false; } }; @@ -165,8 +166,8 @@ function TopBar(el) { TopBar.prototype = { // Set color of status bar - setColor: function(color) { - this.status.style.backgroundColor = color; + setStatus: function(s) { + this.status.setAttribute("s", s); }, // Toggle showing the new game screen |