Buttonset: Ignore hidden buttons. Fixes #5946 - buttonset should ignore buttons that are not :visible.

This commit is contained in:
Scott González 2010-08-18 10:13:57 -04:00
parent 7692b6e65f
commit 9060bf3d09
2 changed files with 13 additions and 6 deletions

View File

@ -5,6 +5,11 @@
module("button: tickets");
test("#5946 - buttonset should ignore buttons that are not :visible", function() {
$( "#radio01" ).next().wrap( "<div></div>" ).parent().hide();
var set = $( "#radio0" ).buttonset();
ok( set.find( "label:eq(0)" ).is( ".ui-button:not(.ui-corner-left)" ) );
ok( set.find( "label:eq(1)" ).is( ".ui-button.ui-corner-left" ) );
});
})(jQuery);

View File

@ -339,11 +339,13 @@ $.widget( "ui.buttonset", {
return $( this ).button( "widget" )[ 0 ];
})
.removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
.filter( ":first" )
.addClass( "ui-corner-left" )
.end()
.filter( ":last" )
.addClass( "ui-corner-right" )
.filter( ":visible" )
.filter( ":first" )
.addClass( "ui-corner-left" )
.end()
.filter( ":last" )
.addClass( "ui-corner-right" )
.end()
.end()
.end();
},