diff options
-rw-r--r-- | ui/jquery.ui.button.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index b2ae0f9df..8e016cb39 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -128,6 +128,14 @@ $.widget( "ui.button", { return; } $( this ).removeClass( "ui-state-active" ); + }) + .bind( "keydown.button", function(event) { + if ( event.keyCode == $.ui.keyCode.SPACE || event.keyCode == $.ui.keyCode.ENTER ) { + $( this ).addClass( "ui-state-active" ); + } + }) + .bind( "keyup.button", function() { + $( this ).removeClass( "ui-state-active" ); }); } |