Save position to fix scroller_upAfterSort=false

This should fix issue #1297 - The current position is now saved on scroll so it can be restored after sorting.
This commit is contained in:
Lars 2017-08-02 15:10:35 +02:00 committed by Rob Garrison
parent 3cd39def50
commit 1b321aae40

View File

@ -273,6 +273,10 @@
$tableWrap $tableWrap
.off( 'scroll' + namespace ) .off( 'scroll' + namespace )
.on( 'scroll' + namespace, function() { .on( 'scroll' + namespace, function() {
//Save position
wo.scroller_saved[0] = $tableWrap.scrollLeft()
wo.scroller_saved[1] = $tableWrap.scrollTop()
if ( wo.scroller_jumpToHeader ) { if ( wo.scroller_jumpToHeader ) {
var pos = $win.scrollTop() - $hdr.offset().top; var pos = $win.scrollTop() - $hdr.offset().top;
if ( $( this ).scrollTop() !== 0 && pos < tbHt && pos > 0 ) { if ( $( this ).scrollTop() !== 0 && pos < tbHt && pos > 0 ) {