Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 356f5a4c94841410abfe40d2d75ee6e51ae1f3d0 1 parent 809cd55
@gabrielschulhof gabrielschulhof authored
Showing with 13 additions and 9 deletions.
  1. +13 −9 js/widgets/popup.js
View
22 js/widgets/popup.js
@@ -109,14 +109,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" ) ) );
+ 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._resizeScreen();
+ this._resizeData = null;
+ this._orientationchangeInProgress = false;
+ }
+ } else {
this._resizeData = null;
this._orientationchangeInProgress = false;
}
@@ -129,8 +134,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" )
Please sign in to comment.
Something went wrong with that request. Please try again.