Skip to content

Commit

Permalink
Bug 370760 - Command span buttons cannot be used via keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Li committed Feb 6, 2012
1 parent f530274 commit ef9bdff
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bundles/org.eclipse.orion.client.core/web/orion/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,17 @@ define(['require', 'dojo', 'dijit', 'orion/util', 'dijit/Menu', 'dijit/form/Drop
this.callback.call(context.handler, context);
}
});
// onClick events do not register for spans when using the keyboard
dojo.connect(element, "onkeypress", this, function(e) {
if (e.keyCode === dojo.keys.ENTER || e.keyCode === dojo.keys.SPACE) {
// collect parameters in advance if specified
if (this.parameters && context.collectsParameters()) {
context.commandService._collectParameters("button", context);
} else if (this.callback) {
this.callback.call(context.handler, context);
}
}
});
var overClass;
if (this.name) {
dojo.place(window.document.createTextNode(this.name), element, "last");
Expand Down

0 comments on commit ef9bdff

Please sign in to comment.