Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
set initial page div's data-url to location.pathname unless it has an…
Browse files Browse the repository at this point in the history
… 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 committed Aug 28, 2011
1 parent 6de7616 commit d63350c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/_assets/css/jqm-docs.css
Expand Up @@ -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; }
Expand Down
2 changes: 1 addition & 1 deletion index.html
Expand Up @@ -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">


Expand Down
4 changes: 2 additions & 2 deletions js/jquery.mobile.init.js
Expand Up @@ -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 );
}
});

Expand Down

0 comments on commit d63350c

Please sign in to comment.