aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.button.js
diff options
context:
space:
mode:
authorGlenn Goodrich <glenn.goodrich@gmail.com>2011-05-26 11:28:17 -0400
committerScott González <scott.gonzalez@gmail.com>2011-05-26 11:28:17 -0400
commitc49dbe0f0120dec9922d5cb6459a93d33ef41579 (patch)
tree873e81c65bca887312112b631668aa1166aa20aa /ui/jquery.ui.button.js
parente89ae5f3bb3e8827960c4f0de5dd1ce1ac5010f5 (diff)
downloadjquery-ui-c49dbe0f0120dec9922d5cb6459a93d33ef41579.tar.gz
jquery-ui-c49dbe0f0120dec9922d5cb6459a93d33ef41579.zip
Button: modified the event bindings for focus and blur. Fixed #6711 - checkbox/radio button do not show focused state when using Keyboard Navigation
Diffstat (limited to 'ui/jquery.ui.button.js')
-rw-r--r--ui/jquery.ui.button.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js
index a95dddc6c..3f3b90e92 100644
--- a/ui/jquery.ui.button.js
+++ b/ui/jquery.ui.button.js
@@ -95,19 +95,21 @@ $.widget( "ui.button", {
}
$( this ).removeClass( hoverClass );
})
- .bind( "focus.button", function() {
- // no need to check disabled, focus won't be triggered anyway
- $( this ).addClass( focusClass );
- })
- .bind( "blur.button", function() {
- $( this ).removeClass( focusClass );
- })
.bind( "click.button", function( event ) {
if ( options.disabled ) {
event.stopImmediatePropagation();
}
});
+ this.element
+ .bind( "focus.button", function() {
+ // no need to check disabled, focus won't be triggered anyway
+ self.buttonElement.addClass( focusClass );
+ })
+ .bind( "blur.button", function() {
+ self.buttonElement.removeClass( focusClass );
+ });
+
if ( toggleButton ) {
this.element.bind( "change.button", function() {
if ( clickDragged ) {