use childPages method to abstract method for finding child pages, hopefully we can find something better than the url selector

This commit is contained in:
John Bender 2011-07-27 13:01:02 -07:00
parent 3035387446
commit 85114be097

View file

@ -223,7 +223,8 @@ $.widget( "mobile.listview", $.mobile.widget, {
parentListId = parentListId || ++listCountPerPage[ parentId ];
$( parentList.find( "li>ul, li>ol" ).toArray().reverse() ).each(function( i ) {
var list = $( this ),
var self = this,
list = $( this ),
listId = list.attr( "id" ) || parentListId + "-" + i,
parent = list.parent(),
nodeEls = $( list.prevAll().toArray().reverse() ),
@ -268,7 +269,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
if( ui.nextPage ){
npURL = nextPage.jqmData( "url" );
if( npURL.indexOf( parentUrl + "&" + $.mobile.subPageUrlKey ) !== 0 ){
$( ":jqmData(url^='"+ parentUrl + "&" + $.mobile.subPageUrlKey +"')").remove();
self.childPages().remove();
parentPage.remove();
}
}