Skip to content

Commit

Permalink
Save position to fix scroller_upAfterSort=false
Browse files Browse the repository at this point in the history
This should fix issue Mottie#1297 - The current position is now saved on scroll so it can be restored after sorting.
  • Loading branch information
lbodtke authored Aug 2, 2017
1 parent ae9cd4b commit 6663187
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions js/widgets/widget-scroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@
$tableWrap
.off( 'scroll' + namespace )
.on( 'scroll' + namespace, function() {
//Save position
wo.scroller_saved[0] = $tableWrap.scrollLeft()
wo.scroller_saved[1] = $tableWrap.scrollTop()

if ( wo.scroller_jumpToHeader ) {
var pos = $win.scrollTop() - $hdr.offset().top;
if ( $( this ).scrollTop() !== 0 && pos < tbHt && pos > 0 ) {
Expand Down

0 comments on commit 6663187

Please sign in to comment.