Scroller: restore scroll position after resize. Fixes #926

This commit is contained in:
Mottie 2015-06-22 08:01:34 -05:00
parent e2c3149229
commit c808f83df1
2 changed files with 7 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -439,6 +439,10 @@ ts.scroller = {
$div.removeClass( tscss.scrollerHideElement ); $div.removeClass( tscss.scrollerHideElement );
// restore scrollTop - fixes #926
$tableWrap.scrollTop( wo.scroller_saved[1] );
wo.scroller_$fixedColumns.find( '.' + tscss.scrollerTable ).scrollTop( wo.scroller_saved[1] );
// update resizable widget handles // update resizable widget handles
setTimeout( function() { setTimeout( function() {
c.$table.trigger( 'resizableUpdate' ); c.$table.trigger( 'resizableUpdate' );
@ -556,7 +560,7 @@ ts.scroller = {
.on( events, function() { .on( events, function() {
if ( wo.scroller_isBusy ) { return; } if ( wo.scroller_isBusy ) { return; }
// using flags to prevent firing the scroll event excessively leading to slow scrolling in Firefox // using flags to prevent firing the scroll event excessively leading to slow scrolling in Firefox
if ( fixedScroll || !( tsScroller.isFirefox || tsScroller.isIE ) ) { if ( !wo.scroller_isBusy && ( fixedScroll || !( tsScroller.isFirefox || tsScroller.isIE ) ) ) {
tableScroll = false; tableScroll = false;
var $this = $( this ); var $this = $( this );
$fixedTbody[0].scrollTop = wo.scroller_saved[1] = $this.scrollTop(); $fixedTbody[0].scrollTop = wo.scroller_saved[1] = $this.scrollTop();
@ -571,7 +575,7 @@ ts.scroller = {
.off( events ) .off( events )
.on( events, function() { .on( events, function() {
// using flags to prevent firing the scroll event excessively leading to slow scrolling in Firefox // using flags to prevent firing the scroll event excessively leading to slow scrolling in Firefox
if ( tableScroll || !( tsScroller.isFirefox || tsScroller.isIE ) ) { if ( !wo.scroller_isBusy && ( tableScroll || !( tsScroller.isFirefox || tsScroller.isIE ) ) ) {
fixedScroll = false; fixedScroll = false;
var $this = $( this ); var $this = $( this );
c.$table.parent()[0].scrollTop = wo.scroller_saved[1] = $this.scrollTop(); c.$table.parent()[0].scrollTop = wo.scroller_saved[1] = $this.scrollTop();