diff --git a/js/jquery.mobile.listview.js b/js/jquery.mobile.listview.js index c2fc9aec..d7626bb6 100644 --- a/js/jquery.mobile.listview.js +++ b/js/jquery.mobile.listview.js @@ -49,13 +49,20 @@ $.widget( "mobile.listview", $.mobile.widget, { }, _removeCorners: function( li, which ) { - which = which || [ "top", "bottom" ]; - var classes = { - top: "ui-corner-top ui-corner-tr ui-corner-tl", - bottom: "ui-corner-bottom ui-corner-br ui-corner-bl" - }; - li.add( li.find( ".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb" ) ) - .removeClass( "ui-corner-top ui-corner-bottom ui-corner-br ui-corner-bl ui-corner-tr ui-corner-tl" ); + var top = "ui-corner-top ui-corner-tr ui-corner-tl", + bot = "ui-corner-bottom ui-corner-br ui-corner-bl"; + + li = li.add( li.find( ".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb" ) ); + + if ( which === "top" ) { + li.removeClass( top ); + } + else if ( which === "bottom" ) { + li.removeClass( bot ); + } + else { + li.removeClass( top + " " + bot ); + } }, refresh: function( create ) { @@ -171,7 +178,7 @@ $.widget( "mobile.listview", $.mobile.widget, { if ( item.prev().prev().length ) { self._removeCorners( item.prev() ); } else if ( item.prev().length ) { - self._removeCorners( item.prev(), ["bottom"] ); + self._removeCorners( item.prev(), "bottom" ); } } }