From 526911bc0e2c878ec80d6a02f728540f94057bf6 Mon Sep 17 00:00:00 2001 From: Andy Janata Date: Sat, 2 Mar 2013 23:50:24 -0800 Subject: [PATCH] Don't update the game list when it isn't visible (i.e. you're already in a game). The client will refresh it when the player leaves their game anyway. This will hopefully cut down on a lot of bandwidth usage -- that's a lot of data sent around whenever anybody joins or leaves any game, and nobody sees it. --- WebContent/js/cah.gamelist.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/WebContent/js/cah.gamelist.js b/WebContent/js/cah.gamelist.js index e2fb46f..245251f 100644 --- a/WebContent/js/cah.gamelist.js +++ b/WebContent/js/cah.gamelist.js @@ -80,8 +80,10 @@ cah.GameList.prototype.hide = function() { * Query the server to update the game list. */ cah.GameList.prototype.update = function() { - // TODO display a loading indicator of some sort - cah.Ajax.build(cah.$.AjaxOperation.GAME_LIST).run(); + if ($(this.element_).is(":visible")) { + // TODO display a loading indicator of some sort + cah.Ajax.build(cah.$.AjaxOperation.GAME_LIST).run(); + } }; /**