Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit 398ecd99f21119a5acea21f943888d3460ba5085 1 parent b793599
@gabrielschulhof gabrielschulhof authored
Showing with 14 additions and 10 deletions.
  1. +14 −10 js/widgets/popup.js
View
24 js/widgets/popup.js
@@ -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" )
Please sign in to comment.
Something went wrong with that request. Please try again.