Permalink
Browse files

Merge pull request #21 from brianantonelli/master

Check for a valid path before guessing the proper URL.
  • Loading branch information...
2 parents eba4e40 + 2144ba9 commit 4329e10df3f1ad8adf2d2e735b03e7b75ea82207 @azicchetti committed Feb 6, 2012
Showing with 5 additions and 4 deletions.
  1. +4 −3 js/jquery.mobile.router.js
  2. +1 −1 js/jquery.mobile.router.min.js
@@ -74,16 +74,17 @@ $(document).bind("mobileinit",function(){
if (config.fixFirstPageDataUrl){
$(document).ready(function(){
+ if (!window.location.pathname.match("/$")){
+ return;
+ }
var page=$(":jqmData(role='page')").first();
var dataUrl=page.jqmData("url"),
guessedDataUrl=window.location.pathname
+config.firstPageDataUrl
+window.location.search
+window.location.hash
;
- if (!window.location.pathname.match("/$")){
- return;
- }
+
if (dataUrl!=guessedDataUrl){
page.attr("data-url",guessedDataUrl)
.jqmData("url",guessedDataUrl);

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 4329e10

Please sign in to comment.