CC-5789 : Builder Cleanup

larger time to disable builder feed check.
This commit is contained in:
Naomi 2014-04-08 19:23:09 -04:00
parent f4f1b68abc
commit 9bfdf5e68f
1 changed files with 21 additions and 7 deletions

View File

@ -226,6 +226,8 @@ var AIRTIME = (function(AIRTIME){
}; };
mod.disableUI = function() { mod.disableUI = function() {
//don't bother checking to update schedule while action is being performed.
clearTimeout(builderCheckTimeout);
$lib.block({ $lib.block({
message: "", message: "",
@ -244,6 +246,8 @@ var AIRTIME = (function(AIRTIME){
$lib.unblock(); $lib.unblock();
$sbContent.unblock(); $sbContent.unblock();
builderCheckTimeout = setTimeout(checkScheduleUpdates, 5000);
}; };
mod.fnRedrawSchedule = function(json) { mod.fnRedrawSchedule = function(json) {
@ -302,6 +306,8 @@ var AIRTIME = (function(AIRTIME){
mod.fnServerData = function fnBuilderServerData( sSource, aoData, fnCallback ) { mod.fnServerData = function fnBuilderServerData( sSource, aoData, fnCallback ) {
clearTimeout(mod.timeout);
console.log("getting builder feed."); console.log("getting builder feed.");
aoData.push( { name: "timestamp", value: getTimestamp()} ); aoData.push( { name: "timestamp", value: getTimestamp()} );
@ -463,7 +469,8 @@ var AIRTIME = (function(AIRTIME){
"fnServerData": mod.fnServerData, "fnServerData": mod.fnServerData,
"fnRowCallback": function fnRowCallback( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { "fnRowCallback": function fnRowCallback( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
var i, length, //console.time("datatablessinglerowrender");
var i, length,
sSeparatorHTML, sSeparatorHTML,
fnPrepareSeparatorRow, fnPrepareSeparatorRow,
$node, $node,
@ -592,13 +599,15 @@ var AIRTIME = (function(AIRTIME){
$image = $nRow.find('td.sb-image'); $image = $nRow.find('td.sb-image');
//check if the file exists. //check if the file exists.
if (aData.image === true) { if (aData.image === true) {
$nRow.addClass("lib-audio"); //$image.html('<img title="'+$.i18n._("Track preview")+'" src="'+baseUrl+'css/images/icon_audioclip.png"></img>');
if (!AIRTIME.playerPreview.isAudioSupported(aData.mime)) { if (!AIRTIME.playerPreview.isAudioSupported(aData.mime)) {
$image.html('<span class="ui-icon ui-icon-locked"></span>'); $image.html('<span class="ui-icon ui-icon-locked"></span>');
} }
else { else {
$image.html('<img title="'+$.i18n._("Track preview")+'" src="'+baseUrl+'css/images/icon_audioclip.png"></img>'); $image.html('<img title="'+$.i18n._("Track preview")+'" src="'+baseUrl+'css/images/icon_audioclip.png"></img>');
} }
} }
else { else {
$image.html('<span class="ui-icon ui-icon-alert"></span>'); $image.html('<span class="ui-icon ui-icon-alert"></span>');
@ -676,17 +685,22 @@ var AIRTIME = (function(AIRTIME){
//save some info for reordering purposes. //save some info for reordering purposes.
$nRow.data({"aData": aData}); $nRow.data({"aData": aData});
//console.timeEnd("datatablessinglerowrender");
}, },
//remove any selected nodes before the draw. //remove any selected nodes before the draw.
"fnPreDrawCallback": function( oSettings ) { "fnPreDrawCallback": function( oSettings ) {
clearTimeout(mod.timeout); console.time("datatablesrender");
clearTimeout(builderCheckTimeout);
//make sure any dragging helpers are removed or else they'll be stranded on the screen. //make sure any dragging helpers are removed or else they'll be stranded on the screen.
$("#draggingContainer").remove(); $("#draggingContainer").remove();
console.time("datatablesrowrender");
}, },
"fnDrawCallback": function fnBuilderDrawCallback(oSettings, json) { "fnDrawCallback": function fnBuilderDrawCallback(oSettings, json) {
console.timeEnd("datatablesrowrender");
var aData, var aData,
elements, elements,
i, length, temp, i, length, temp,
@ -733,7 +747,7 @@ var AIRTIME = (function(AIRTIME){
mod.checkToolBarIcons(); mod.checkToolBarIcons();
builderCheckTimeout = setTimeout(checkScheduleUpdates, 5000); console.timeEnd("datatablesrender");
}, },
// R = ColReorder, C = ColVis // R = ColReorder, C = ColVis