diff options
author | Felix Nagel <info@felixnagel.com> | 2012-11-23 13:49:12 +0100 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2012-11-23 13:49:12 +0100 |
commit | e25cdd88e7f2558311492957e379e11f987a1080 (patch) | |
tree | a0353f8f3ef49537618721d0bbd7cfab2b432759 /ui/jquery.ui.button.js | |
parent | 0d4a8dca55562131212f2638af4bf05052a41b2a (diff) | |
parent | 421aeaa08135e747ff9f2a59974c26b350cdcda7 (diff) | |
download | jquery-ui-e25cdd88e7f2558311492957e379e11f987a1080.tar.gz jquery-ui-e25cdd88e7f2558311492957e379e11f987a1080.zip |
Merge branch 'master' into selectmenu
Diffstat (limited to 'ui/jquery.ui.button.js')
-rw-r--r-- | ui/jquery.ui.button.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index db04b63b8..d6eed67dc 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -29,6 +29,7 @@ var lastActive, startXPos, startYPos, clickDragged, form = radio.form, radios = $( [] ); if ( name ) { + name = name.replace( /'/g, "\\'" ); if ( form ) { radios = $( form ).find( "[name='" + name + "']" ); } else { @@ -192,7 +193,9 @@ $.widget( "ui.button", { $( this ).addClass( "ui-state-active" ); } }) - .bind( "keyup" + this.eventNamespace, function() { + // see #8559, we bind to blur here in case the button element loses + // focus between keydown and keyup, it would be left in an "active" state + .bind( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() { $( this ).removeClass( "ui-state-active" ); }); @@ -283,7 +286,9 @@ $.widget( "ui.button", { }, refresh: function() { - var isDisabled = this.element.is( ":disabled" ) || this.element.hasClass( "ui-button-disabled" ); + //See #8237 & #8828 + var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" ); + if ( isDisabled !== this.options.disabled ) { this._setOption( "disabled", isDisabled ); } |