From af9508481c64d0da629c21a826a2af8f0dc6421d Mon Sep 17 00:00:00 2001 From: scottjehl Date: Wed, 13 Oct 2010 20:16:50 -0400 Subject: [PATCH] Removed correct side of rounded corners on buttons in listviews that either precede or follow dividers. Note that this will also make sure there's no bottom corners on a button that predes a divider that comes last, if that ever happens. Fixes #139 --- js/jquery.mobile.listview.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/js/jquery.mobile.listview.js b/js/jquery.mobile.listview.js index e378872a..e14c538b 100644 --- a/js/jquery.mobile.listview.js +++ b/js/jquery.mobile.listview.js @@ -168,6 +168,18 @@ $.widget( "mobile.listview", $.mobile.widget, { .addClass( "ui-li-thumb" ); if ( o.inset ) { + + //remove corners before or after dividers + var sides = ['top','bottom']; + $.each( sides, function( i ){ + var side = sides[ i ]; + $list.find( ".ui-corner-" + side ).each(function(){ + if( $(this).parents('li')[ i == 0 ? 'prev' : 'next' ]( ".ui-li-divider" ).length ){ + $(this).removeClass( "ui-corner-" + side ); + } + }); + }); + this.element .find( "img" ) .filter( "li:first-child img" )