in uima-ducc-web/src/main/webapp/root/opensources/DataTables-1.10.1/extensions/Scroller/js/dataTables.scroller.js [739:845]
"_fnDrawCallback": function ()
{
var
that = this,
heights = this.s.heights,
iScrollTop = this.dom.scroller.scrollTop,
iActualScrollTop = iScrollTop,
iScrollBottom = iScrollTop + heights.viewport,
iTableHeight = $(this.s.dt.nTable).height(),
displayStart = this.s.dt._iDisplayStart,
displayLen = this.s.dt._iDisplayLength,
displayEnd = this.s.dt.fnRecordsDisplay();
// Disable the scroll event listener while we are updating the DOM
this.s.skip = true;
// Resize the scroll forcing element
this._fnScrollForce();
// Reposition the scrolling for the updated virtual position if needed
if ( displayStart === 0 ) {
// Linear calculation at the top of the table
iScrollTop = this.s.topRowFloat * heights.row;
}
else if ( displayStart + displayLen >= displayEnd ) {
// Linear calculation that the bottom as well
iScrollTop = heights.scroll - ((displayEnd - this.s.topRowFloat) * heights.row);
}
else {
// Domain scaled in the middle
iScrollTop = this._domain( 'virtualToPhysical', this.s.topRowFloat * heights.row );
}
this.dom.scroller.scrollTop = iScrollTop;
// Store positional information so positional calculations can be based
// upon the current table draw position
this.s.baseScrollTop = iScrollTop;
this.s.baseRowTop = this.s.topRowFloat;
// Position the table in the virtual scroller
var tableTop = iScrollTop - ((this.s.topRowFloat - displayStart) * heights.row);
if ( displayStart === 0 ) {
tableTop = 0;
}
else if ( displayStart + displayLen >= displayEnd ) {
tableTop = heights.scroll - iTableHeight;
}
this.dom.table.style.top = tableTop+'px';
/* Cache some information for the scroller */
this.s.tableTop = tableTop;
this.s.tableBottom = iTableHeight + this.s.tableTop;
// Calculate the boundaries for where a redraw will be triggered by the
// scroll event listener
var boundaryPx = (iScrollTop - this.s.tableTop) * this.s.boundaryScale;
this.s.redrawTop = iScrollTop - boundaryPx;
this.s.redrawBottom = iScrollTop + boundaryPx;
this.s.skip = false;
// Restore the scrolling position that was saved by DataTable's state
// saving Note that this is done on the second draw when data is Ajax
// sourced, and the first draw when DOM soured
if ( this.s.dt.oFeatures.bStateSave && this.s.dt.oLoadedState !== null &&
typeof this.s.dt.oLoadedState.iScroller != 'undefined' )
{
// A quirk of DataTables is that the draw callback will occur on an
// empty set if Ajax sourced, but not if server-side processing.
var ajaxSourced = (this.s.dt.sAjaxSource || that.s.dt.ajax) && ! this.s.dt.oFeatures.bServerSide ?
true :
false;
if ( ( ajaxSourced && this.s.dt.iDraw == 2) ||
(!ajaxSourced && this.s.dt.iDraw == 1) )
{
setTimeout( function () {
$(that.dom.scroller).scrollTop( that.s.dt.oLoadedState.iScroller );
that.s.redrawTop = that.s.dt.oLoadedState.iScroller - (heights.viewport/2);
// In order to prevent layout thrashing we need another
// small delay
setTimeout( function () {
that.s.ingnoreScroll = false;
}, 0 );
}, 0 );
}
}
else {
that.s.ingnoreScroll = false;
}
// Because of the order of the DT callbacks, the info update will
// take precedence over the one we want here. So a 'thread' break is
// needed
setTimeout( function () {
that._fnInfo.call( that );
}, 0 );
// Hide the loading indicator
if ( this.dom.loader && this.s.loaderVisible ) {
this.dom.loader.css( 'display', 'none' );
this.s.loaderVisible = false;
}
},