Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[popup] When destroying a popup, run close() before un-enhancing if i…

…t is the currently active popup -- Fixes #5123
  • Loading branch information...
commit 0586202fe62352ebc6538d348dc365e98bee0187 1 parent 86de757
@gabrielschulhof gabrielschulhof authored
Showing with 10 additions and 4 deletions.
  1. +10 −4 js/widgets/popup.js
View
14 js/widgets/popup.js
@@ -646,10 +646,7 @@ define( [ "jquery",
});
},
- _destroy: function() {
- // hide and remove bindings
- this._close();
-
+ _unenhance: function() {
// Put the element back to where the placeholder was and remove the "ui-popup" class
this._setTheme( "none" );
this.element
@@ -660,6 +657,15 @@ define( [ "jquery",
this._ui.placeholder.remove();
},
+ _destroy: function() {
+ if ( $.mobile.popup.active === this ) {
+ this.element.one( "popupafterclose", $.proxy( this, "_unenhance" ) );
+ this.close();
+ } else {
+ this._unenhance();
+ }
+ },
+
// any navigation event after a popup is opened should close the popup
// NOTE the pagebeforechange is bound to catch navigation events that don't
// alter the url (eg, dialogs from popups)
Please sign in to comment.
Something went wrong with that request. Please try again.