Permalink
Browse files

Panel: Set min-height when panel is open. Prevents vertical scrollbar…

…. Fixes #5456 and fixes #5471.
1 parent a3507d1 commit e235f4f503835f94bb2bcb7eed420f29e387232d @jaspermdegroot jaspermdegroot committed Jan 17, 2013
Showing with 13 additions and 7 deletions.
  1. +13 −7 js/widgets/panel.js
View
@@ -112,7 +112,6 @@ $.widget( "mobile.panel", $.mobile.widget, {
if ( self.options.dismissible ) {
self._createModal();
}
-
},
_createModal: function( options ) {
@@ -157,13 +156,17 @@ $.widget( "mobile.panel", $.mobile.widget, {
_positionPanel: function() {
var self = this,
- pannelInnerHeight = self._pannelInner.height();
-
- if ( ( pannelInnerHeight > $.mobile.getScreenHeight() ) || !this.options.positionFixed ) {
- this._unfixPanel();
- this._scrollIntoView( pannelInnerHeight );
+ pannelInnerHeight = self._pannelInner.outerHeight(),
+ expand = pannelInnerHeight > $.mobile.getScreenHeight();
+
+ if ( expand || !self.options.positionFixed ) {
+ if ( expand ) {
+ self._unfixPanel();
+ $.mobile.resetActivePageHeight( pannelInnerHeight );
+ }
+ self._scrollIntoView( pannelInnerHeight );
} else {
- this._fixPanel();
+ self._fixPanel();
}
},
@@ -244,6 +247,7 @@ $.widget( "mobile.panel", $.mobile.widget, {
_open: false,
_contentWrapOpenClasses: null,
+ _fixedToolbarOpenClasses: null,
_modalOpenClasses: null,
open: function( immediate ) {
@@ -304,6 +308,7 @@ $.widget( "mobile.panel", $.mobile.widget, {
self._page.removeClass( o.classes.pagePanelOpen );
self._fixPanel();
self._unbindFixListener();
+ $.mobile.resetActivePageHeight();
self._trigger( "close" );
};
if ( this.element.closest( ".ui-page-active" ).length < 0 ) {
@@ -349,6 +354,7 @@ $.widget( "mobile.panel", $.mobile.widget, {
if ( theme ) {
this._page.removeClass( "ui-body-" + theme ).addClass( this._pageTheme );
}
+ $.mobile.resetActivePageHeight();
}
} else if ( this._open ) {
this._wrapper.removeClass( classes.contentWrapOpen );

0 comments on commit e235f4f

Please sign in to comment.