From eed8c95343f26050be85efbd6ca538c6f890a605 Mon Sep 17 00:00:00 2001 From: martin Date: Tue, 5 Apr 2011 16:42:23 -0400 Subject: [PATCH] CC-2162: WADR Widget "There is an error in current show timing" --- plugins/jquery.showinfo.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/plugins/jquery.showinfo.js b/plugins/jquery.showinfo.js index d38cff6c4..8c4e01c2d 100644 --- a/plugins/jquery.showinfo.js +++ b/plugins/jquery.showinfo.js @@ -89,10 +89,18 @@ return this.each(function() { var obj = $(this); - var sd; + var sd = null; getServerData(); + //refresh the UI to update the elapsed/remaining time + setInterval(updateWidget, 1000); + function updateWidget(){ + + if (sd == null){ + return; + } + var currentShow = sd.getCurrentShow(); var nextShows = sd.getNextShows(); @@ -126,14 +134,10 @@ "" + "" + ""); - - //refresh the UI to update the elapsed/remaining time - setTimeout(updateWidget, 1000); } function processData(data){ sd = new ScheduleData(data); - updateWidget(); } function airtimeScheduleJsonpError(jqXHR, textStatus, errorThrown){