From b5b24ae8f1357145bf54ccf8b22c1c23518875b8 Mon Sep 17 00:00:00 2001 From: Naomi Aro Date: Wed, 2 May 2012 11:14:53 +0200 Subject: [PATCH] CC-3735 : Now Playing: Browser(Firefox) Mem usage goes high when play a show with hundreds of songs more than 3 hours --- airtime_mvc/public/js/airtime/library/library.js | 2 +- airtime_mvc/public/js/airtime/showbuilder/builder.js | 12 ++++++------ .../public/js/airtime/showbuilder/main_builder.js | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index f25c96967..a7abdfee4 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -591,7 +591,7 @@ var AIRTIME = (function(AIRTIME) { }(AIRTIME || {})); -function checkImportStatus(){ +function checkImportStatus() { $.getJSON('/Preference/is-import-in-progress', function(data){ var div = $('#import_status'); var table = $('#library_display').dataTable(); diff --git a/airtime_mvc/public/js/airtime/showbuilder/builder.js b/airtime_mvc/public/js/airtime/showbuilder/builder.js index 4a115b120..70031fa51 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/builder.js @@ -50,6 +50,11 @@ var AIRTIME = (function(AIRTIME){ return mod.showInstances; }; + mod.refresh = function() { + mod.resetTimestamp(); + oSchedTable.fnDraw(); + }; + mod.checkTrimButton = function() { $over = $sbTable.find(".sb-over"); @@ -499,7 +504,6 @@ var AIRTIME = (function(AIRTIME){ var wrapperDiv, markerDiv, $td, - $tr, aData, elements, i, length, temp, @@ -570,11 +574,7 @@ var AIRTIME = (function(AIRTIME){ if (temp.length > 0) { aData = temp.data("aData"); - setTimeout(function(){ - mod.resetTimestamp(); - oSchedTable.fnDraw(); - }, aData.refresh * 1000); //need refresh in milliseconds - + setTimeout(mod.refresh, aData.refresh * 1000); //need refresh in milliseconds break; } } diff --git a/airtime_mvc/public/js/airtime/showbuilder/main_builder.js b/airtime_mvc/public/js/airtime/showbuilder/main_builder.js index 9301dd42a..c796908ec 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/main_builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/main_builder.js @@ -206,8 +206,7 @@ AIRTIME = (function(AIRTIME) { } }); - //check if the timeline viewed needs updating. - setInterval(function(){ + function checkScheduleUpdates(){ var data = {}, oTable = $('#show_builder_table').dataTable(), fn = oTable.fnSettings().fnServerData, @@ -235,10 +234,11 @@ AIRTIME = (function(AIRTIME) { oTable.fnDraw(); } } - } ); - - }, 5 * 1000); //need refresh in milliseconds - + } ); + } + + //check if the timeline view needs updating. + setInterval(checkScheduleUpdates, 5 * 1000); //need refresh in milliseconds }; mod.onResize = function() {