Skip to content
Permalink
Browse files

Buttonset: Ignore hidden buttons. Fixes #5946 - buttonset should igno…

…re buttons that are not :visible.
  • Loading branch information
scottgonzalez committed Aug 18, 2010
1 parent 7692b6e commit 9060bf3d09a547563e94815f9e0a1c4908ebd904
Showing with 13 additions and 6 deletions.
  1. +6 −1 tests/unit/button/button_tickets.js
  2. +7 −5 ui/jquery.ui.button.js
@@ -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);
@@ -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();
},

0 comments on commit 9060bf3

Please sign in to comment.
You can’t perform that action at this time.