Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit 556a4e3

Browse files
author
Gabriel Schulhof
committed
Popup: Hide popup when offscreen. Fixes #5892.
1 parent 1f63741 commit 556a4e3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

js/widgets/popup.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ $.widget( "mobile.popup", $.mobile.widget, {
232232
.addClass( "ui-popup" )
233233
.appendTo( ui.container );
234234
ui.focusElement = ui.container;
235+
ui.container.hide();
235236

236237
// Define instance variables
237238
$.extend( this, {
@@ -595,6 +596,8 @@ $.widget( "mobile.popup", $.mobile.widget, {
595596
return false;
596597
}());
597598

599+
this._ui.container.show();
600+
598601
// Count down to triggering "popupafteropen" - we have two prerequisites:
599602
// 1. The popup window animation completes (container())
600603
// 2. The screen opacity animation completes (screen())
@@ -659,6 +662,7 @@ $.widget( "mobile.popup", $.mobile.widget, {
659662

660663
_closePrereqsDone: function() {
661664
this._ui.container.removeAttr( "tabindex" );
665+
this._ui.container.hide();
662666

663667
// remove the global mutex for popups
664668
$.mobile.popup.active = undefined;

0 commit comments

Comments
 (0)