This patch fixes problem when base url is changed when site is prefetched.
authorPrzemyslaw Ciezkowski <p.ciezkowski@samsung.com>
Wed, 3 Apr 2013 10:53:33 +0000 (12:53 +0200)
committerYoumin Ha <youmin.ha@samsung.com>
Fri, 5 Apr 2013 07:33:13 +0000 (16:33 +0900)
Fixes navigation problems with links data-ajax=false

Patch from jqm: https://github.com/jquery/jquery-mobile/issues/5677

Change-Id: Idafbdb952693e2543a34a5c071c3a59f1dc6b0dd

libs/patch/0040-navigation-fix.patch [new file with mode: 0644]

diff --git a/libs/patch/0040-navigation-fix.patch b/libs/patch/0040-navigation-fix.patch
new file mode 100644 (file)
index 0000000..740bca3
--- /dev/null
@@ -0,0 +1,57 @@
+From 35377ae9b70887b91d20b1898dbf903a3a28d03a Mon Sep 17 00:00:00 2001
+From: Przemyslaw Ciezkowski <p.ciezkowski@samsung.com>
+Date: Wed, 3 Apr 2013 12:52:54 +0200
+Subject: [PATCH] navigation-fix
+
+Change-Id: Id1713bdcb51129043f520e164bf5fbe6fe67727f
+---
+ .../js/jquery.mobile.navigation.js                 |   12 +++++++++---
+ 1 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.js
+index 9048789..694a7f0 100644
+--- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.js
++++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.navigation.js
+@@ -763,6 +763,10 @@ define( [
+                       if ( !settings.reloadPage ) {
+                               enhancePage( page, settings.role );
+                               deferred.resolve( absUrl, options, page );
++                              //if we are reloading the page make sure we update the base if its not a prefetch
++                              if( base && !options.prefetch ){
++                                      base.set(url);
++                              }
+                               return deferred.promise();
+                       }
+                       dupCachedPage = page;
+@@ -799,7 +803,8 @@ define( [
+               }
+               // Reset base to the default document base.
+-              if ( base ) {
++              // only reset if we are not prefetching
++              if ( base && typeof options.prefetch === "undefined" ) {
+                       base.reset();
+               }
+@@ -834,7 +839,8 @@ define( [
+                                               url = fileUrl = path.getFilePath( $( "<div>" + RegExp.$1 + "</div>" ).text() );
+                                       }
+-                                      if ( base ) {
++                                      //dont update the base tag if we are prefetching
++                                      if ( base && typeof options.prefetch === "undefined") {
+                                               base.set( fileUrl );
+                                       }
+@@ -1442,7 +1448,7 @@ define( [
+                               if ( url && $.inArray( url, urls ) === -1 ) {
+                                       urls.push( url );
+-                                      $.mobile.loadPage( url, { role: $link.attr( "data-" + $.mobile.ns + "rel" ) } );
++                                      $.mobile.loadPage( url, { role: $link.attr( "data-" + $.mobile.ns + "rel" ),prefetch: true } );
+                               }
+                       });
+               });
+-- 
+1.7.5.4
+