Buttonset: Use :data(button) instead of .ui-button to find buttons that have already been instantiated. This prevents us from finding elements that are proxying buttons, e.g., a radio's label.

Fixes #5242 - radio buttonset with icons does not maintain state.
This commit is contained in:
Scott González 2010-03-02 02:58:52 +00:00
parent c16246f502
commit 001a22a9d6

View File

@ -236,7 +236,7 @@ $.widget( "ui.button", {
$.widget( "ui.buttonset", {
_create: function() {
this.element.addClass( "ui-button-set" );
this.buttons = this.element.find( ":button, :submit, :reset, :checkbox, :radio, a, .ui-button" )
this.buttons = this.element.find( ":button, :submit, :reset, :checkbox, :radio, a, :data(button)" )
.button()
.map(function() {
return $( this ).button( "widget" )[ 0 ];
@ -269,5 +269,5 @@ $.widget( "ui.buttonset", {
}
});
$.fn.log = function() { console.log(this); return this; };
})( jQuery );