summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMax Li2012-01-26 16:45:39 (EST)
committer sfranklin2012-01-26 16:45:39 (EST)
commitfc640ed27b5553027929f23e1ed302a48146c49e (patch)
tree5d36e140a2163616263ce28072b6ba4f68b87e33
parentfaa0752703f213c213639242ae921d4c3441203c (diff)
downloadorg.eclipse.orion.client-fc640ed27b5553027929f23e1ed302a48146c49e.zip
org.eclipse.orion.client-fc640ed27b5553027929f23e1ed302a48146c49e.tar.gz
org.eclipse.orion.client-fc640ed27b5553027929f23e1ed302a48146c49e.tar.bz2
Bug 368875 - Clone Repository buttons inaccessible
-rw-r--r--bundles/org.eclipse.orion.client.core/web/orion/globalCommands.js46
1 files changed, 35 insertions, 11 deletions
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/globalCommands.js b/bundles/org.eclipse.orion.client.core/web/orion/globalCommands.js
index b3dda44..daa8967 100644
--- a/bundles/org.eclipse.orion.client.core/web/orion/globalCommands.js
+++ b/bundles/org.eclipse.orion.client.core/web/orion/globalCommands.js
@@ -97,7 +97,7 @@ define(['require', 'dojo', 'dijit', 'orion/commands', 'orion/util', 'orion/textv
// add the close button if the fill function did not.
var spacer = dojo.create("span", null, this.dismissArea, "last");
dojo.addClass(spacer, "dismiss");
- var close = dojo.create("span", {id: "parameterClose"}, this.dismissArea, "last");
+ var close = dojo.create("span", {id: "parameterClose", role: "button", tabindex: "0"}, this.dismissArea, "last");
dojo.addClass(close, "imageSprite");
dojo.addClass(close, "core-sprite-delete");
dojo.addClass(close, "dismiss");
@@ -105,6 +105,12 @@ define(['require', 'dojo', 'dijit', 'orion/commands', 'orion/util', 'orion/textv
dojo.connect(close, "onclick", dojo.hitch(this, function(event) {
this.close(commandNode);
}));
+ // onClick events do not register for spans when using the keyboard without a screen reader
+ dojo.connect(close, "onkeypress", dojo.hitch(this, function (e) {
+ if(e.keyCode === dojo.keys.ENTER) {
+ this.close(commandNode);
+ }
+ }));
}
@@ -196,38 +202,51 @@ define(['require', 'dojo', 'dijit', 'orion/commands', 'orion/util', 'orion/textv
});
var spacer;
var parentDismiss = parameterArea;
+ var finish = function () {
+ this._collectAndCall(commandInvocation, parameterArea);
+ localClose();
+ };
if (commandInvocation.parameters.options) {
commandInvocation.parameters.optionsRequested = false;
spacer = dojo.create("span", null, parentDismiss, "last");
dojo.addClass(spacer, "dismiss");
- var options = dojo.create("span", null, parentDismiss, "last");
+ var options = dojo.create("span", {role: "button", tabindex: "0"}, parentDismiss, "last");
dojo.addClass(options, "core-sprite-options");
dojo.addClass(options, "dismiss");
options.title = "More options...";
- dojo.connect(options, "onclick", dojo.hitch(this, function () {
+ dojo.connect(options, "onclick", dojo.hitch(this, function() {
commandInvocation.parameters.optionsRequested = true;
- this._collectAndCall(commandInvocation, parameterArea);
- localClose();
+ finish();
+ }));
+ // onClick events do not register for spans when using the keyboard without a screen reader
+ dojo.connect(options, "onkeypress", dojo.hitch(this, function (e) {
+ if(e.keyCode === dojo.keys.ENTER) {
+ commandInvocation.parameters.optionsRequested = true;
+ finish();
+ }
}));
}
// OK and cancel buttons
spacer = dojo.create("span", null, parentDismiss, "last");
dojo.addClass(spacer, "dismiss");
- var ok = dojo.create("span", null, parentDismiss, "last");
+ var ok = dojo.create("span", {role: "button", tabindex: "0"}, parentDismiss, "last");
ok.title = "Submit";
dojo.addClass(ok, "core-sprite-ok");
dojo.addClass(ok, "dismiss");
- dojo.connect(ok, "onclick", dojo.hitch(this, function () {
- this._collectAndCall(commandInvocation, parameterArea);
- localClose();
+ dojo.connect(ok, "onclick", dojo.hitch(this, finish));
+ // onClick events do not register for spans when using the keyboard without a screen reader
+ dojo.connect(ok, "onkeypress", dojo.hitch(this, function (e) {
+ if(e.keyCode === dojo.keys.ENTER) {
+ finish();
+ }
}));
spacer = dojo.create("span", null, parentDismiss, "last");
dojo.addClass(spacer, "dismiss");
- var close = dojo.create("span", {id: "parameterClose"}, parentDismiss, "last");
+ var close = dojo.create("span", {id: "parameterClose", role: "button", tabindex: "0"}, parentDismiss, "last");
dojo.addClass(close, "imageSprite");
dojo.addClass(close, "core-sprite-delete");
dojo.addClass(close, "dismiss");
@@ -235,7 +254,12 @@ define(['require', 'dojo', 'dijit', 'orion/commands', 'orion/util', 'orion/textv
dojo.connect(close, "onclick", dojo.hitch(this, function(event) {
localClose();
}));
-
+ // onClick events do not register for spans when using the keyboard without a screen reader
+ dojo.connect(close, "onkeypress", dojo.hitch(this, function (e) {
+ if(e.keyCode === dojo.keys.ENTER) {
+ localClose();
+ }
+ }));
return first;
});
}