@@ -815,24 +815,27 @@ define( [
815
815
// params have access to them in the event bindings for the page
816
816
// life cycle See issue #5085
817
817
settings . target = toPage ;
818
+ settings . deferred = $ . Deferred ( ) ;
818
819
819
- $ . mobile . loadPage ( toPage , settings )
820
- . done ( function ( url , options , newPage ) {
821
- isPageTransitioning = false ;
822
-
823
- // store the original absolute url so that it can be provided
824
- // to events in the triggerData of the subsequent changePage call
825
- newPage . data ( "absUrl" , triggerData . absUrl ) ;
826
- $ . mobile . changePage ( newPage , options ) ;
827
- } )
828
- . fail ( $ . proxy ( function ( /* url, options */ ) {
829
- //clear out the active button state
830
- removeActiveLinkClass ( true ) ;
831
-
832
- //release transition lock so navigation is free again
833
- releasePageTransitionLock ( ) ;
834
- this . element . trigger ( "pagechangefailed" , triggerData ) ;
835
- } , this ) ) ;
820
+ this . load ( toPage , settings ) ;
821
+
822
+ settings . deferred . done ( function ( url , options , newPage ) {
823
+ isPageTransitioning = false ;
824
+
825
+ // store the original absolute url so that it can be provided
826
+ // to events in the triggerData of the subsequent changePage call
827
+ newPage . data ( "absUrl" , triggerData . absUrl ) ;
828
+ $ . mobile . changePage ( newPage , options ) ;
829
+ } ) ;
830
+
831
+ settings . deferred . fail ( $ . proxy ( function ( /* url, options */ ) {
832
+ //clear out the active button state
833
+ removeActiveLinkClass ( true ) ;
834
+
835
+ //release transition lock so navigation is free again
836
+ releasePageTransitionLock ( ) ;
837
+ this . element . trigger ( "pagechangefailed" , triggerData ) ;
838
+ } , this ) ) ;
836
839
837
840
return ;
838
841
}
0 commit comments