Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Panel: Always scroll to top when opening a panel, unless it it's a fi…
Browse files Browse the repository at this point in the history
…xed panel. Fixes #5858.
  • Loading branch information
jaspermdegroot committed Jul 25, 2013
1 parent 1ef88f5 commit af1f5a2
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions js/widgets/panel.js
Expand Up @@ -172,18 +172,12 @@ $.widget( "mobile.panel", {
self._unfixPanel();
$.mobile.resetActivePageHeight( panelInnerHeight );
}
self._scrollIntoView( panelInnerHeight );
window.scrollTo( 0, $.mobile.defaultHomeScroll );
} else {
self._fixPanel();
}
},

_scrollIntoView: function( panelInnerHeight ) {
if ( panelInnerHeight < $( window ).scrollTop() ) {
window.scrollTo( 0, 0 );
}
},

_bindFixListener: function() {
this._on( $( window ), { "throttledresize": "_positionPanel" });
},
Expand Down

0 comments on commit af1f5a2

Please sign in to comment.