From 8c71ee5dff2972db04f25f9fac1eeabfa72f91c3 Mon Sep 17 00:00:00 2001 From: Kin Blas Date: Thu, 14 Apr 2011 23:36:58 -0700 Subject: [PATCH] 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. --- js/jquery.mobile.listview.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/js/jquery.mobile.listview.js b/js/jquery.mobile.listview.js index e3a9533f..c39c760d 100644 --- a/js/jquery.mobile.listview.js +++ b/js/jquery.mobile.listview.js @@ -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" ); });