Permalink
Browse files

set initial page div's data-url to location.pathname unless it has an…

… ID on it. This fixes an issue where going back to the initial page will end up generating a new homepage rather than transitioning to the one already in the dom.
  • Loading branch information...
scottjehl
scottjehl committed Aug 28, 2011
1 parent 6de7616 commit d63350ca6cc6ee88a8f7549f24ceedc59f7e2ade
Showing with 4 additions and 4 deletions.
  1. +1 −1 docs/_assets/css/jqm-docs.css
  2. +1 −1 index.html
  3. +2 −2 js/jquery.mobile.init.js
@@ -6,7 +6,7 @@ cobblers, shoes,
body { background: #dddddd; }
-.ui-mobile #jqm-home { background: #e5e5e5 url(../images/jqm-sitebg.png) top center repeat-x; }
+.ui-mobile .type-home { background: #e5e5e5 url(../images/jqm-sitebg.png) top center repeat-x; }
.ui-mobile #jqm-homeheader { padding: 40px 10px 0; text-align: center; margin: 0 auto; }
.ui-mobile #jqm-homeheader h1 { margin: 0 0 ; }
.ui-mobile #jqm-homeheader p { margin: .3em 0 0; line-height: 1.3; font-size: .9em; font-weight: bold; color: #666; }
View
@@ -13,7 +13,7 @@
</head>
<body>
-<div data-role="page" id="jqm-home" class="type-home">
+<div data-role="page" class="type-home">
<div data-role="content">
View
@@ -83,9 +83,9 @@
$pages.add( ":jqmData(role='dialog')" ).each(function() {
var $this = $(this);
- // unless the data url is already set set it to the id
+ // unless the data url is already set set it to the pathname
if ( !$this.jqmData("url") ) {
- $this.attr( "data-" + $.mobile.ns + "url", $this.attr( "id" ) );
+ $this.attr( "data-" + $.mobile.ns + "url", $this.attr( "id" ) || location.pathname );
}
});

0 comments on commit d63350c

Please sign in to comment.