From 85114be097920f2ed89fa4216ae65bbd3a3c8581 Mon Sep 17 00:00:00 2001 From: John Bender Date: Wed, 27 Jul 2011 13:01:02 -0700 Subject: [PATCH] use childPages method to abstract method for finding child pages, hopefully we can find something better than the url selector --- js/jquery.mobile.listview.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/jquery.mobile.listview.js b/js/jquery.mobile.listview.js index 16583c83..bca5c2c2 100644 --- a/js/jquery.mobile.listview.js +++ b/js/jquery.mobile.listview.js @@ -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(); } }