mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-12 02:11:02 +00:00
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.
This commit is contained in:
parent
6de76168af
commit
d63350ca6c
3 changed files with 4 additions and 4 deletions
|
|
@ -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; }
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue