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.
This commit is contained in:
Kin Blas 2011-04-14 23:36:58 -07:00
parent b83d81962e
commit 8c71ee5dff

View file

@ -29,10 +29,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
$list.addClass( "ui-listview-inset ui-corner-all ui-shadow" );
}
this._itemApply( $list, $list );
this.refresh( true );
this.refresh();
},
_itemApply: function( $list, item ) {
@ -44,8 +41,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
item.find( "p, dl" ).addClass( "ui-li-desc" );
var children = item.children();
children.filter("img:eq(0)").add(children.eq(0).children("img:eq(0)")).addClass( "ui-li-thumb" ).each(function() {
item.find("img:first-child:eq(0)").addClass( "ui-li-thumb" ).each(function() {
item.addClass( $(this).is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );
});