diff --git a/js/jquery.mobile.listview.js b/js/jquery.mobile.listview.js index c516dbf01fe..9bfbbca0be1 100644 --- a/js/jquery.mobile.listview.js +++ b/js/jquery.mobile.listview.js @@ -29,7 +29,7 @@ $.widget( "mobile.listview", $.mobile.widget, { $list.addClass( "ui-listview-inset ui-corner-all ui-shadow" ); } - this._itemApply( $list, $list ); + this._itemApply( $list, $list.find("li") ); this.refresh( true ); @@ -44,7 +44,7 @@ $.widget( "mobile.listview", $.mobile.widget, { item.find( "p, dl" ).addClass( "ui-li-desc" ); - $list.find( "li" ).find( ">img:eq(0), >:first>img:eq(0)" ).addClass( "ui-li-thumb" ).each(function() { + item.find( "img:eq(0)" ).addClass( "ui-li-thumb" ).each(function() { $( this ).closest( "li" ).addClass( $(this).is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" ); }); diff --git a/tests/functional/dynamicInsetList.html b/tests/functional/dynamicInsetList.html new file mode 100644 index 00000000000..e606233f28b --- /dev/null +++ b/tests/functional/dynamicInsetList.html @@ -0,0 +1,69 @@ + + + + + jQuery Mobile: Grid Layout + + + + + + + + +
+
+

Dynamic Inset List

+
+ +
+

Touch events on this page will log out below, prepending to the top as they arrive.

+ +

Option *.5s are dynamicly inserted when 'pagebeforeshow' event invoked. Click options to remove it.

+ + + + + +
+
+ +