initializing only when viewed. fixes flash buttons, saves load time.
This commit is contained in:
parent
dd0115f573
commit
63ce35b38d
1 changed files with 31 additions and 10 deletions
|
@ -270,13 +270,29 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
timeStartId = "#his_time_start",
|
timeStartId = "#his_time_start",
|
||||||
dateEndId = "#his_date_end",
|
dateEndId = "#his_date_end",
|
||||||
timeEndId = "#his_time_end",
|
timeEndId = "#his_time_end",
|
||||||
$hisDialogEl;
|
$hisDialogEl,
|
||||||
|
|
||||||
|
tabsInit = [
|
||||||
|
{
|
||||||
|
initialized: false,
|
||||||
|
initialize: function() {
|
||||||
|
oTableItem = itemHistoryTable();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
initialized: false,
|
||||||
|
initialize: function() {
|
||||||
|
oTableAgg = aggregateHistoryTable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
$historyContentDiv = $("#history_content");
|
$historyContentDiv = $("#history_content");
|
||||||
|
|
||||||
function redrawTables() {
|
function redrawTables() {
|
||||||
oTableAgg.fnDraw();
|
oTableAgg && oTableAgg.fnDraw();
|
||||||
oTableItem.fnDraw();
|
oTableItem && oTableItem.fnDraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeHistoryDialog() {
|
function removeHistoryDialog() {
|
||||||
|
@ -341,9 +357,6 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
minuteText: $.i18n._("Minute")
|
minuteText: $.i18n._("Minute")
|
||||||
};
|
};
|
||||||
|
|
||||||
oTableItem = itemHistoryTable();
|
|
||||||
oTableAgg = aggregateHistoryTable();
|
|
||||||
|
|
||||||
$historyContentDiv.find(dateStartId).datepicker(oBaseDatePickerSettings);
|
$historyContentDiv.find(dateStartId).datepicker(oBaseDatePickerSettings);
|
||||||
$historyContentDiv.find(timeStartId).timepicker(oBaseTimePickerSettings);
|
$historyContentDiv.find(timeStartId).timepicker(oBaseTimePickerSettings);
|
||||||
$historyContentDiv.find(dateEndId).datepicker(oBaseDatePickerSettings);
|
$historyContentDiv.find(dateEndId).datepicker(oBaseDatePickerSettings);
|
||||||
|
@ -453,7 +466,16 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$historyContentDiv.find("#his-tabs").tabs();
|
$historyContentDiv.find("#his-tabs").tabs({
|
||||||
|
show: function( event, ui ) {
|
||||||
|
var tab = tabsInit[ui.index];
|
||||||
|
|
||||||
|
if (!tab.initialized) {
|
||||||
|
tab.initialize();
|
||||||
|
tab.initialized = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// begin context menu initialization.
|
// begin context menu initialization.
|
||||||
$.contextMenu({
|
$.contextMenu({
|
||||||
|
@ -496,8 +518,7 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
|
|
||||||
if (c) {
|
if (c) {
|
||||||
$.post(deleteUrl, {format: "json"}, function(json) {
|
$.post(deleteUrl, {format: "json"}, function(json) {
|
||||||
oTableItem.fnDraw();
|
redrawTables();
|
||||||
oTableAgg.fnDraw();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue