Permalink
Browse files

Fix for #2865: when it's the first time we load the page, use the pag…

…e title if there is one
  • Loading branch information...
1 parent 3e99437 commit f81888c4e14c166ece407855045b7e9b8908e5b3 Ghislain Seguin committed Oct 28, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 js/jquery.mobile.navigation.js
@@ -1111,8 +1111,9 @@
path.set( url );
}
- //if title element wasn't found, try the page div data attr too
- var newPageTitle = toPage.jqmData( "title" ) || toPage.children(":jqmData(role='header')").find(".ui-title" ).getEncodedText();
+ // if title element wasn't found, try the page div data attr too
+ // If this is a deep-link or a reload ( active === undefined ) then just use pageTitle
+ var newPageTitle = ( !active )? pageTitle : toPage.jqmData( "title" ) || toPage.children(":jqmData(role='header')").find(".ui-title" ).getEncodedText();
if( !!newPageTitle && pageTitle == document.title ) {
pageTitle = newPageTitle;
}

0 comments on commit f81888c

Please sign in to comment.