Permalink
Browse files

Panel: Do not scroll to top upon updatelayout

Closes gh-7128
Fixes gh-6688
Re gh-5535
  • Loading branch information...
gabrielschulhof committed Feb 18, 2014
1 parent 65ad2f9 commit f6cf315b259b555d63c45a6668936ad82166eb7f
Showing with 5 additions and 3 deletions.
  1. +5 −3 js/widgets/panel.js
View
@@ -167,7 +167,7 @@ $.widget( "mobile.panel", {
});
},
- _positionPanel: function() {
+ _positionPanel: function( scrollToTop ) {
var self = this,
panelInnerHeight = self._panelInner.outerHeight(),
expand = panelInnerHeight > $.mobile.getScreenHeight();
@@ -177,7 +177,9 @@ $.widget( "mobile.panel", {
self._unfixPanel();
$.mobile.resetActivePageHeight( panelInnerHeight );
}
- window.scrollTo( 0, $.mobile.defaultHomeScroll );
+ if ( scrollToTop ) {
+ this.window[ 0 ].scrollTo( 0, $.mobile.defaultHomeScroll );
+ }
} else {
self._fixPanel();
}
@@ -324,7 +326,7 @@ $.widget( "mobile.panel", {
.removeClass( o.classes.panelClosed )
.addClass( o.classes.panelOpen );
- self._positionPanel();
+ self._positionPanel( true );
self._pageContentOpenClasses = self._getPosDisplayClasses( o.classes.pageContentPrefix );

0 comments on commit f6cf315

Please sign in to comment.