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

This commit is contained in:
John Bender 2011-09-12 14:06:47 -07:00
parent fbd113bad4
commit c426aefd76
2 changed files with 10 additions and 2 deletions

View file

@ -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;

View file

@ -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