Permalink
Browse files

Popup: Ignore resize events right after a click

Closes gh-7323
Fixes gh-6961
  • Loading branch information...
gabrielschulhof committed Apr 14, 2014
1 parent fbe4cc6 commit 5342dfd16fcce0e35eb5ce666ebab6f5bd2e95f6
Showing with 12 additions and 0 deletions.
  1. +12 −0 js/widgets/popup.js
View
@@ -75,6 +75,14 @@ $.widget( "mobile.popup", {
history: !$.mobile.browser.oldIE
},
// When the user depresses the mouse/finger on an element inside the popup while the popup is
// open, we ignore resize events for a short while. This prevents #6961.
_handleDocumentVmousedown: function( theEvent ) {
if ( this._isOpen && $.contains( this._ui.container[ 0 ], theEvent.target ) ) {
this._ignoreResizeEvents();
}
},
_create: function() {
var theElement = this.element,
myId = theElement.attr( "id" ),
@@ -85,6 +93,10 @@ $.widget( "mobile.popup", {
// it is determined whether there shall be AJAX nav.
currentOptions.history = currentOptions.history && $.mobile.ajaxEnabled && $.mobile.hashListeningEnabled;
this._on( this.document, {
"vmousedown": "_handleDocumentVmousedown"
});
// Define instance variables
$.extend( this, {
_scrollTop: 0,

0 comments on commit 5342dfd

Please sign in to comment.