Skip to content

Commit 701b381

Browse files
committed
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.
1 parent 522b48e commit 701b381

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

js/jquery.mobile.navigation.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -826,12 +826,6 @@
826826
return;
827827
}
828828

829-
// Set the isPageTransitioning flag to prevent any requests from
830-
// entering this method while we are in the midst of loading a page
831-
// or transitioning.
832-
833-
isPageTransitioning = true;
834-
835829
var settings = $.extend( {}, $.mobile.changePage.defaults, options );
836830

837831
// Make sure we have a pageContainer to work with.
@@ -842,14 +836,19 @@
842836
url = toPage;
843837

844838
// Let listeners know we're about to change the current page.
845-
mpc.trigger( bcpEvent, url, settings );
839+
mpc.trigger( bcpEvent, { url: url, settings: settings } );
846840

847841
// If the default behavior is prevented, stop here!
848842
if( bcpEvent.isDefaultPrevented() ){
849843
return;
850844
}
851845

852-
846+
// Set the isPageTransitioning flag to prevent any requests from
847+
// entering this method while we are in the midst of loading a page
848+
// or transitioning.
849+
850+
isPageTransitioning = true;
851+
853852
// If the caller passed us a url, call loadPage()
854853
// to make sure it is loaded into the DOM. We'll listen
855854
// to the promise object it returns so we know when

0 commit comments

Comments
 (0)