diff --git a/js/jquery.mobile.listview.js b/js/jquery.mobile.listview.js index 3e5200b0368..de221c4e651 100644 --- a/js/jquery.mobile.listview.js +++ b/js/jquery.mobile.listview.js @@ -277,31 +277,35 @@ $.widget( "mobile.listview", $.mobile.widget, { o = this.options, persistentFooterID = parentPage.find( "[data-role='footer']" ).data( "id" ); - $( parentList.find( "ul, ol" ).toArray().reverse() ).each(function( i ) { - var list = $( this ), - parent = list.parent(), - title = parent.contents()[ 0 ].nodeValue.split("\n")[0], + $( parentList.find( "ul, ol,[data-role='subpage']" ).not("[data-role='subpage'] *").toArray().reverse() ).each(function( i ) { + var content = $( this ), + parent = content.parent(), + titleElement = parent.children("[data-role='subpagetitle']").eq(0).wrapInner(""), + title = titleElement.length ? titleElement.text() : parent.contents()[ 0 ].nodeValue.split("\n")[0], id = parentId + "&" + $.mobile.subPageUrlKey + "=" + $.mobile.idStringEscape(title + " " + i), - theme = list.data( "theme" ) || o.theme, - countTheme = list.data( "counttheme" ) || parentList.data( "counttheme" ) || o.countTheme, - newPage = list.wrap( "