Permalink
Browse files

Couple of modifications to changePage():

- Moved the setting of isPageTransitioning *AFTER* the beforechangepage notification.

- Modified the trigger("beforechangepage") call to pass the args to changePage() as an object since trigger only expects one data arg.
  • Loading branch information...
1 parent 522b48e commit 701b381cc4eb9e6310dc6ad99671420b2ee06c39 @jblas jblas committed Sep 6, 2011
Showing with 7 additions and 8 deletions.
  1. +7 −8 js/jquery.mobile.navigation.js
View
15 js/jquery.mobile.navigation.js
@@ -826,12 +826,6 @@
return;
}
- // Set the isPageTransitioning flag to prevent any requests from
- // entering this method while we are in the midst of loading a page
- // or transitioning.
-
- isPageTransitioning = true;
-
var settings = $.extend( {}, $.mobile.changePage.defaults, options );
// Make sure we have a pageContainer to work with.
@@ -842,14 +836,19 @@
url = toPage;
// Let listeners know we're about to change the current page.
- mpc.trigger( bcpEvent, url, settings );
+ mpc.trigger( bcpEvent, { url: url, settings: settings } );
// If the default behavior is prevented, stop here!
if( bcpEvent.isDefaultPrevented() ){
return;
}
-
+ // Set the isPageTransitioning flag to prevent any requests from
+ // entering this method while we are in the midst of loading a page
+ // or transitioning.
+
+ isPageTransitioning = true;
+
// If the caller passed us a url, call loadPage()
// to make sure it is loaded into the DOM. We'll listen
// to the promise object it returns so we know when

0 comments on commit 701b381

Please sign in to comment.