Permalink
Browse files

[popup] Only rapid-open the popup if it is open -- Fixes #5157

  • Loading branch information...
1 parent b793599 commit 398ecd99f21119a5acea21f943888d3460ba5085 @gabrielschulhof gabrielschulhof committed Oct 23, 2012
Showing with 14 additions and 10 deletions.
  1. +14 −10 js/widgets/popup.js
View
@@ -112,14 +112,19 @@ define( [ "jquery",
},
_resizeTimeout: function() {
- if ( !this._maybeRefreshTimeout() ) {
- // effectively rapid-open the popup while leaving the screen intact
- this._trigger( "beforeposition" );
- this._ui.container
- .removeClass( "ui-selectmenu-hidden" )
- .offset( this._placementCoords( this._desiredCoords( undefined, undefined, "window" ) ) );
-
- this._resizeScreen();
+ if ( this._isOpen ) {
+ if ( !this._maybeRefreshTimeout() ) {
+ // effectively rapid-open the popup while leaving the screen intact
+ this._trigger( "beforeposition" );
+ this._ui.container
+ .removeClass( "ui-selectmenu-hidden" )
+ .offset( this._placementCoords( this._desiredCoords( undefined, undefined, "window" ) ) );
+
+ this._resizeScreen();
+ this._resizeData = null;
+ this._orientationchangeInProgress = false;
+ }
+ } else {
this._resizeData = null;
this._orientationchangeInProgress = false;
}
@@ -132,8 +137,7 @@ define( [ "jquery",
},
_handleWindowOrientationchange: function( e ) {
-
- if ( !this._orientationchangeInProgress ) {
+ if ( !this._orientationchangeInProgress && this._isOpen ) {
// effectively rapid-close the popup while leaving the screen intact
this._ui.container
.addClass( "ui-selectmenu-hidden" )

0 comments on commit 398ecd9

Please sign in to comment.