Skip to content
This repository
Browse code

[popup] Perform the visual open only when the nav hook has been acqui…

…red -- Fixes #4949
  • Loading branch information...
commit 3b40d0374c11ccae31ada39e5813927abb2376f9 1 parent e740c15
Gabriel "_|Nix|_" Schulhof authored September 07, 2012

Showing 1 changed file with 5 additions and 4 deletions. Show diff stats Hide diff stats

  1. 9  js/widgets/popup.js
9  js/widgets/popup.js
@@ -514,8 +514,6 @@ define( [ "jquery",
514 514
 					}
515 515
 					return false;
516 516
 				}());
517  
-			// set the global popup mutex
518  
-			$.mobile.popup.active = this;
519 517
 
520 518
 			// Make sure options is defined
521 519
 			options = ( options || {} );
@@ -680,8 +678,8 @@ define( [ "jquery",
680 678
 				return;
681 679
 			}
682 680
 
683  
-			// forward the options on to the visual open
684  
-			self._open( options );
  681
+			// set the global popup mutex
  682
+			$.mobile.popup.active = this;
685 683
 
686 684
 			// if history alteration is disabled close on navigate events
687 685
 			// and leave the url as is
@@ -723,6 +721,9 @@ define( [ "jquery",
723 721
 			opts.container.one( opts.navigateEvents, function( e ) {
724 722
 				e.preventDefault();
725 723
 				self._bindContainerClose();
  724
+
  725
+				// forward the options on to the visual open
  726
+				self._open( options );
726 727
 			});
727 728
 
728 729
 			// Gotta love methods with 1mm args :(

2 notes on commit 3b40d03

John Bender

@gabrielschulhof

I think this breaks popups without history :(

John Bender

We have to take another look at this, I wrote some poor tests for the "historyless" popups and this change breaks them (obviously without failing the tests)

Please sign in to comment.
Something went wrong with that request. Please try again.