mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-14 01:23:10 +00:00
fixed up logic and code style for the _removeCorners "which" argument. Thx for the logic suggestion, @eugenb1. Fixes #1996.
This commit is contained in:
parent
4703fe0d24
commit
e567742c90
1 changed files with 15 additions and 8 deletions
|
|
@ -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" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue