Merge branch '2.1.x' of dev.sourcefabric.org:airtime into 2.1.x
This commit is contained in:
commit
22862688a8
|
@ -8,7 +8,9 @@ var AIRTIME = (function(AIRTIME){
|
||||||
$sbTable,
|
$sbTable,
|
||||||
$toolbar,
|
$toolbar,
|
||||||
$ul,
|
$ul,
|
||||||
$lib;
|
$lib,
|
||||||
|
cursors = [],
|
||||||
|
cursorIds = [];
|
||||||
|
|
||||||
if (AIRTIME.showbuilder === undefined) {
|
if (AIRTIME.showbuilder === undefined) {
|
||||||
AIRTIME.showbuilder = {};
|
AIRTIME.showbuilder = {};
|
||||||
|
@ -208,6 +210,11 @@ var AIRTIME = (function(AIRTIME){
|
||||||
|
|
||||||
mod.fnItemCallback = function(json) {
|
mod.fnItemCallback = function(json) {
|
||||||
checkError(json);
|
checkError(json);
|
||||||
|
|
||||||
|
cursors = $(".cursor-selected-row");
|
||||||
|
for (i = 0; i < cursors.length; i++) {
|
||||||
|
cursorIds.push(($(cursors.get(i)).attr("id")));
|
||||||
|
}
|
||||||
oSchedTable.fnDraw();
|
oSchedTable.fnDraw();
|
||||||
|
|
||||||
mod.enableUI();
|
mod.enableUI();
|
||||||
|
@ -401,7 +408,6 @@ var AIRTIME = (function(AIRTIME){
|
||||||
headerIcon;
|
headerIcon;
|
||||||
|
|
||||||
fnPrepareSeparatorRow = function fnPrepareSeparatorRow(sRowContent, sClass, iNodeIndex) {
|
fnPrepareSeparatorRow = function fnPrepareSeparatorRow(sRowContent, sClass, iNodeIndex) {
|
||||||
|
|
||||||
$node = $(nRow.children[iNodeIndex]);
|
$node = $(nRow.children[iNodeIndex]);
|
||||||
$node.html(sRowContent);
|
$node.html(sRowContent);
|
||||||
$node.attr('colspan',100);
|
$node.attr('colspan',100);
|
||||||
|
@ -414,6 +420,8 @@ var AIRTIME = (function(AIRTIME){
|
||||||
$nRow.addClass(sClass);
|
$nRow.addClass(sClass);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$nRow.attr("id", aData.id);
|
||||||
|
|
||||||
if (aData.header === true) {
|
if (aData.header === true) {
|
||||||
//remove the column classes from all tds.
|
//remove the column classes from all tds.
|
||||||
$nRow.find('td').removeClass();
|
$nRow.find('td').removeClass();
|
||||||
|
@ -615,6 +623,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
$cursorRows,
|
$cursorRows,
|
||||||
$table = $(this),
|
$table = $(this),
|
||||||
$parent = $table.parent(),
|
$parent = $table.parent(),
|
||||||
|
$tr,
|
||||||
//use this array to cache DOM heights then we can detach the table to manipulate it to increase speed.
|
//use this array to cache DOM heights then we can detach the table to manipulate it to increase speed.
|
||||||
heights = [];
|
heights = [];
|
||||||
|
|
||||||
|
@ -653,8 +662,16 @@ var AIRTIME = (function(AIRTIME){
|
||||||
});
|
});
|
||||||
|
|
||||||
$td.append(markerDiv).wrapInner(wrapperDiv);
|
$td.append(markerDiv).wrapInner(wrapperDiv);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//re-highlight selected cursors before draw took place
|
||||||
|
for (i = 0; i < cursorIds.length; i++) {
|
||||||
|
$tr = $table.find("tr[id="+cursorIds[i]+"]");
|
||||||
|
mod.selectCursor($tr);
|
||||||
|
}
|
||||||
|
cursorIds = [];
|
||||||
|
|
||||||
//if there is only 1 cursor on the page highlight it by default.
|
//if there is only 1 cursor on the page highlight it by default.
|
||||||
if ($cursorRows.length === 1) {
|
if ($cursorRows.length === 1) {
|
||||||
$td = $cursorRows.find("td:first");
|
$td = $cursorRows.find("td:first");
|
||||||
|
@ -678,8 +695,14 @@ var AIRTIME = (function(AIRTIME){
|
||||||
|
|
||||||
if (temp.length > 0) {
|
if (temp.length > 0) {
|
||||||
aData = temp.data("aData");
|
aData = temp.data("aData");
|
||||||
|
// max time interval
|
||||||
mod.timeout = setTimeout(mod.refresh, aData.refresh * 1000); //need refresh in milliseconds
|
// setTimeout allow only up to 2^21 millisecs timeout value
|
||||||
|
maxRefreshInterval = Math.pow(2, 31) - 1;
|
||||||
|
refreshInterval = aData.refresh * 1000;
|
||||||
|
if(refreshInterval > maxRefreshInterval){
|
||||||
|
refreshInterval = maxRefreshInterval;
|
||||||
|
}
|
||||||
|
mod.timeout = setTimeout(mod.refresh, refreshInterval); //need refresh in milliseconds
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ AIRTIME = (function(AIRTIME) {
|
||||||
|
|
||||||
oBaseDatePickerSettings = {
|
oBaseDatePickerSettings = {
|
||||||
dateFormat: 'yy-mm-dd',
|
dateFormat: 'yy-mm-dd',
|
||||||
onSelect: function(sDate, oDatePicker) {
|
onClick: function(sDate, oDatePicker) {
|
||||||
$(this).datepicker( "setDate", sDate );
|
$(this).datepicker( "setDate", sDate );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue