From b48f0adccb11619680a47cac5fa9c68f638bd489 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Sun, 17 May 2020 13:15:41 -0400 Subject: [WebCards] Update from my local repos --- webcards/scripts/gui/lobby.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'webcards/scripts/gui/lobby.js') 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 -- cgit v1.2.3