aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2010-01-22 22:52:31 +0000
committerJörn Zaefferer <joern.zaefferer@gmail.com>2010-01-22 22:52:31 +0000
commitaa63c4b9594aed63ef43e5aa0ecad6fecd8f8d60 (patch)
tree7439571d751f118cdae779fa0e3963ae912e0714
parent967454c43443e19b270f13be3840c451edecdfbc (diff)
downloadjquery-ui-aa63c4b9594aed63ef43e5aa0ecad6fecd8f8d60.tar.gz
jquery-ui-aa63c4b9594aed63ef43e5aa0ecad6fecd8f8d60.zip
button: handle space "click"
-rw-r--r--ui/jquery.ui.button.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js
index 8e016cb39..d69e912ff 100644
--- a/ui/jquery.ui.button.js
+++ b/ui/jquery.ui.button.js
@@ -137,6 +137,14 @@ $.widget( "ui.button", {
.bind( "keyup.button", function() {
$( this ).removeClass( "ui-state-active" );
});
+ if (this.buttonElement.is("a")) {
+ this.buttonElement.keyup(function(event) {
+ if (event.keyCode == $.ui.keyCode.SPACE) {
+ // TODO pass through original event correctly (just as 2nd argument doesn't work)
+ $(this).trigger("click");
+ }
+ })
+ }
}
this._resetButton();