Permalink
Browse files

Popup: Hide popup when offscreen. Fixes #5892.

  • Loading branch information...
gabrielschulhof committed Apr 17, 2013
1 parent 1f63741 commit 556a4e3304f30b25c312253474d98ee069a52cbf
Showing with 4 additions and 0 deletions.
  1. +4 −0 js/widgets/popup.js
View
@@ -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, {
@@ -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())
@@ -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;

0 comments on commit 556a4e3

Please sign in to comment.