Skip to content

Commit 8c71ee5

Browse files
committed
Fix for issue 1458 - Listview thumbnails aren't rendering correctly.
Needed to modify _itemApply() to look for the first image that is the first child of its parent. I may need to tweak this at a later point because the selector is still too general.
1 parent b83d819 commit 8c71ee5

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

js/jquery.mobile.listview.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
2929
$list.addClass( "ui-listview-inset ui-corner-all ui-shadow" );
3030
}
3131

32-
this._itemApply( $list, $list );
33-
34-
this.refresh( true );
35-
32+
this.refresh();
3633
},
3734

3835
_itemApply: function( $list, item ) {
@@ -44,8 +41,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
4441

4542
item.find( "p, dl" ).addClass( "ui-li-desc" );
4643

47-
var children = item.children();
48-
children.filter("img:eq(0)").add(children.eq(0).children("img:eq(0)")).addClass( "ui-li-thumb" ).each(function() {
44+
item.find("img:first-child:eq(0)").addClass( "ui-li-thumb" ).each(function() {
4945
item.addClass( $(this).is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );
5046
});
5147

0 commit comments

Comments
 (0)