Skip to content
Permalink
Browse files

Button: Added refresh method to buttonset, futher fixes #5278 - ui.bu…

…ttons doesn't visually reset on form "reset" event or input "change" event
  • Loading branch information...
rdworth committed Mar 17, 2010
1 parent 124f846 commit 2a8271c7016be902aed15cd2ccadc23164159a8d
Showing with 23 additions and 10 deletions.
  1. +23 −10 ui/jquery.ui.button.js
@@ -312,12 +312,33 @@ $.widget( "ui.button", {
$.widget( "ui.buttonset", {
_create: function() {
this.element.addClass( "ui-button-set" );
this._init();
},

_init: function() {
this.refresh();
},

_setOption: function( key, value ) {
if ( key === "disabled" ) {
this.buttons.button( "option", key, value );
}

$.Widget.prototype._setOption.apply( this, arguments );
},

refresh: function() {
this.buttons = this.element.find( ":button, :submit, :reset, :checkbox, :radio, a, :data(button)" )
.button()
.filter( ":ui-button" )
.button( "refresh" )
.end()
.not( ":ui-button" )
.button()
.end()
.map(function() {
return $( this ).button( "widget" )[ 0 ];
})
.removeClass( "ui-corner-all" )
.removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
.filter( ":first" )
.addClass( "ui-corner-left" )
.end()
@@ -327,14 +348,6 @@ $.widget( "ui.buttonset", {
.end();
},

_setOption: function( key, value ) {
if ( key === "disabled" ) {
this.buttons.button( "option", key, value );
}

$.Widget.prototype._setOption.apply( this, arguments );
},

destroy: function() {
this.element.removeClass( "ui-button-set" );
this.buttons

0 comments on commit 2a8271c

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