RLG-Web client: explain when there are no games to watch

If no games are available for watching, display a message saying so
instead of showing an empty table.
This commit is contained in:
John "Elwin" Edwards 2012-06-18 16:53:44 -07:00
parent 2bdd26b2f4
commit ceed48eee5
3 changed files with 14 additions and 0 deletions

View file

@ -429,6 +429,14 @@ function getcurrent() {
var gamediv = document.getElementById("gametable");
while (gamediv.children.length > 2)
gamediv.removeChild(optdiv.children[2]);
if (reply.g.length === 0) {
gamediv.style.display = "none";
document.getElementById("nogames").style.display = "block";
}
else {
gamediv.style.display = "table";
document.getElementById("nogames").style.display = "none";
}
for (var i = 0; i < reply.g.length; i++) {
var row = document.createElement("div");
var cell1 = document.createElement("div");