mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-27 17:34:45 +00:00
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.
This commit is contained in:
parent
522b48ee84
commit
701b381cc4
1 changed files with 7 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue