Skip to content

Commit

Permalink
Buttonset: Ignore hidden buttons. Fixes #5946 - buttonset should igno…
Browse files Browse the repository at this point in the history
…re buttons that are not :visible.
  • Loading branch information
scottgonzalez committed Aug 18, 2010
1 parent 7692b6e commit 9060bf3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
7 changes: 6 additions & 1 deletion tests/unit/button/button_tickets.js
Expand Up @@ -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);
12 changes: 7 additions & 5 deletions ui/jquery.ui.button.js
Expand Up @@ -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();
},
Expand Down

0 comments on commit 9060bf3

Please sign in to comment.