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

Commit f6cf315

Browse files
author
Gabriel Schulhof
committed
Panel: Do not scroll to top upon updatelayout
Closes gh-7128 Fixes gh-6688 Re gh-5535
1 parent 65ad2f9 commit f6cf315

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

js/widgets/panel.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ $.widget( "mobile.panel", {
167167
});
168168
},
169169

170-
_positionPanel: function() {
170+
_positionPanel: function( scrollToTop ) {
171171
var self = this,
172172
panelInnerHeight = self._panelInner.outerHeight(),
173173
expand = panelInnerHeight > $.mobile.getScreenHeight();
@@ -177,7 +177,9 @@ $.widget( "mobile.panel", {
177177
self._unfixPanel();
178178
$.mobile.resetActivePageHeight( panelInnerHeight );
179179
}
180-
window.scrollTo( 0, $.mobile.defaultHomeScroll );
180+
if ( scrollToTop ) {
181+
this.window[ 0 ].scrollTo( 0, $.mobile.defaultHomeScroll );
182+
}
181183
} else {
182184
self._fixPanel();
183185
}
@@ -324,7 +326,7 @@ $.widget( "mobile.panel", {
324326
.removeClass( o.classes.panelClosed )
325327
.addClass( o.classes.panelOpen );
326328

327-
self._positionPanel();
329+
self._positionPanel( true );
328330

329331
self._pageContentOpenClasses = self._getPosDisplayClasses( o.classes.pageContentPrefix );
330332

0 commit comments

Comments
 (0)