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

Commit

Permalink
Popup: Hide popup when offscreen. Fixes #5892.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Schulhof committed Apr 17, 2013
1 parent 1f63741 commit 556a4e3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions js/widgets/popup.js
Expand Up @@ -232,6 +232,7 @@ $.widget( "mobile.popup", $.mobile.widget, {
.addClass( "ui-popup" )
.appendTo( ui.container );
ui.focusElement = ui.container;
ui.container.hide();

// Define instance variables
$.extend( this, {
Expand Down Expand Up @@ -595,6 +596,8 @@ $.widget( "mobile.popup", $.mobile.widget, {
return false;
}());

this._ui.container.show();

// Count down to triggering "popupafteropen" - we have two prerequisites:
// 1. The popup window animation completes (container())
// 2. The screen opacity animation completes (screen())
Expand Down Expand Up @@ -659,6 +662,7 @@ $.widget( "mobile.popup", $.mobile.widget, {

_closePrereqsDone: function() {
this._ui.container.removeAttr( "tabindex" );
this._ui.container.hide();

// remove the global mutex for popups
$.mobile.popup.active = undefined;
Expand Down

0 comments on commit 556a4e3

Please sign in to comment.