@@ -729,6 +729,7 @@ define( [
729
729
. jqmData ( "url" , dataUrl ) ;
730
730
}
731
731
732
+
732
733
// If we failed to find a page in the DOM, check the URL to see if it
733
734
// refers to the first page in the application. If it isn't a reference
734
735
// to the first page and refers to non-existent embedded page, error out.
@@ -750,7 +751,7 @@ define( [
750
751
return deferred . promise ( ) ;
751
752
}
752
753
}
753
-
754
+
754
755
// If the page we are interested in is already in the DOM,
755
756
// and the caller did not indicate that we should force a
756
757
// reload of the file, we are done. Otherwise, track the
@@ -759,11 +760,14 @@ define( [
759
760
if ( ! settings . reloadPage ) {
760
761
enhancePage ( page , settings . role ) ;
761
762
deferred . resolve ( absUrl , options , page ) ;
763
+ //if we are reloading the page make sure we update the base if its not a prefetch
764
+ if ( base && ! options . prefetch ) {
765
+ base . set ( url ) ;
766
+ }
762
767
return deferred . promise ( ) ;
763
768
}
764
769
dupCachedPage = page ;
765
770
}
766
-
767
771
var mpc = settings . pageContainer ,
768
772
pblEvent = new $ . Event ( "pagebeforeload" ) ,
769
773
triggerData = { url : url , absUrl : absUrl , dataUrl : dataUrl , deferred : deferred , options : settings } ;
@@ -793,9 +797,9 @@ define( [
793
797
$ . mobile . hidePageLoadingMsg ( ) ;
794
798
} ;
795
799
}
796
-
797
800
// Reset base to the default document base.
798
- if ( base ) {
801
+ // only reset if we are not prefetching
802
+ if ( base && typeof options . prefetch === "undefined" ) {
799
803
base . reset ( ) ;
800
804
}
801
805
@@ -829,8 +833,8 @@ define( [
829
833
RegExp . $1 ) {
830
834
url = fileUrl = path . getFilePath ( $ ( "<div>" + RegExp . $1 + "</div>" ) . text ( ) ) ;
831
835
}
832
-
833
- if ( base ) {
836
+ //dont update the base tag if we are prefetching
837
+ if ( base && typeof options . prefetch === "undefined" ) {
834
838
base . set ( fileUrl ) ;
835
839
}
836
840
@@ -1438,7 +1442,7 @@ define( [
1438
1442
if ( url && $ . inArray ( url , urls ) === - 1 ) {
1439
1443
urls . push ( url ) ;
1440
1444
1441
- $ . mobile . loadPage ( url , { role : $link . attr ( "data-" + $ . mobile . ns + "rel" ) } ) ;
1445
+ $ . mobile . loadPage ( url , { role : $link . attr ( "data-" + $ . mobile . ns + "rel" ) , prefetch : true } ) ;
1442
1446
}
1443
1447
} ) ;
1444
1448
} ) ;
0 commit comments