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
This commit is contained in:
scottjehl 2010-10-13 20:16:50 -04:00
parent cc6389b707
commit af9508481c

View file

@ -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" )