diff options
author | Scott González <scott.gonzalez@gmail.com> | 2014-04-01 14:42:38 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2014-04-01 14:42:38 -0400 |
commit | 0059722b6b43c4985dbbd5f1494524442c12ddb0 (patch) | |
tree | 73d80beaecb0832da98b0ae9fadd5632a425e3ed /ui/button.js | |
parent | f3ffc8c9a94da8abe97a32d164f821ad8a9a8b60 (diff) | |
download | jquery-ui-0059722b6b43c4985dbbd5f1494524442c12ddb0.tar.gz jquery-ui-0059722b6b43c4985dbbd5f1494524442c12ddb0.zip |
Button: Properly refresh button sets with new radio buttons
Fixes #8975
Ref gh-888
Diffstat (limited to 'ui/button.js')
-rw-r--r-- | ui/button.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/ui/button.js b/ui/button.js index d9b027541..247aba6e5 100644 --- a/ui/button.js +++ b/ui/button.js @@ -366,15 +366,17 @@ $.widget( "ui.buttonset", { }, refresh: function() { - var rtl = this.element.css( "direction" ) === "rtl"; + var rtl = this.element.css( "direction" ) === "rtl", + allButtons = this.element.find( this.options.items ), + existingButtons = allButtons.filter( ":ui-button" ); - this.buttons = this.element.find( this.options.items ) - .filter( ":ui-button" ) - .button( "refresh" ) - .end() - .not( ":ui-button" ) - .button() - .end() + // Initialize new buttons + allButtons.not( ":ui-button" ).button(); + + // Refresh existing buttons + existingButtons.button( "refresh" ); + + this.buttons = allButtons .map(function() { return $( this ).button( "widget" )[ 0 ]; }) |