Permalink
Browse files

add data attribute tag for pages loaded via ajax Fixes #2432

  • Loading branch information...
1 parent fbd113b commit c426aefd764d7a2242af0713fd8c0b4a23f942b9 @johnbender johnbender committed Sep 12, 2011
Showing with 10 additions and 2 deletions.
  1. +6 −2 js/jquery.mobile.listview.js
  2. +4 −0 js/jquery.mobile.navigation.js
@@ -269,8 +269,12 @@ $.widget( "mobile.listview", $.mobile.widget, {
}).listview();
- //on pagehide, remove any nested pages along with the parent page, as long as they aren't active
- if( hasSubPages && parentPage.data("page").options.domCache === false ){
+ // on pagehide, remove any nested pages along with the parent page, as long as they aren't active
+ // and aren't embedded
+ if( hasSubPages &&
+ parentPage.is( "jqmData(external-page='true')" ) &&
+ parentPage.data("page").options.domCache === false ) {
+
var newRemove = function( e, ui ){
var nextPage = ui.nextPage, npURL;
@@ -784,8 +784,12 @@
}
//append to page and enhance
+ // TODO taging a page with external to make sure that embedded pages aren't removed
+ // by the various page handling code is bad. Having page handling code in many
+ // places is bad. Solutions post 1.0
page
.attr( "data-" + $.mobile.ns + "url", path.convertUrlToDataUrl( fileUrl ) )
+ .attr( "data-" + $.mobile.ns + "external-page", true )
.appendTo( settings.pageContainer );
// wait for page creation to leverage options defined on widget

0 comments on commit c426aef

Please sign in to comment.