aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Li2012-02-15 14:50:36 (EST)
committersfranklin2012-02-16 16:56:55 (EST)
commitacb6e4bd50581001eb6ec46f83b97a5faa69d889 (patch)
treef0a278bc668ea56212e3a545a25fb044cc2ec19e
parent3d51f134b97895b08a4001bb9be058d49ec20ccd (diff)
downloadorg.eclipse.orion.client-acb6e4bd50581001eb6ec46f83b97a5faa69d889.zip
org.eclipse.orion.client-acb6e4bd50581001eb6ec46f83b97a5faa69d889.tar.gz
org.eclipse.orion.client-acb6e4bd50581001eb6ec46f83b97a5faa69d889.tar.bz2
Bug 371674 - Some Command image buttons are unlabeled
-rw-r--r--bundles/org.eclipse.orion.client.core/web/orion/commands.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/commands.js b/bundles/org.eclipse.orion.client.core/web/orion/commands.js
index add5bb4..8fc50b3 100644
--- a/bundles/org.eclipse.orion.client.core/web/orion/commands.js
+++ b/bundles/org.eclipse.orion.client.core/web/orion/commands.js
@@ -933,10 +933,7 @@ define(['require', 'dojo', 'dijit', 'orion/util', 'dijit/Menu', 'dijit/form/Drop
} else {
image = addImageToElement(this, element, name);
// ensure there is accessible text describing this image
- var label = this.name || this.tooltip;
- if (label) {
- dojo.attr(element, "aria-label", label);
- }
+ this._addAccessibleLabel(element);
}
this._hookCallback(element, context);
var overClass = image ? "commandImageOver" : "commandButtonOver";
@@ -982,6 +979,8 @@ define(['require', 'dojo', 'dijit', 'orion/util', 'dijit/Menu', 'dijit/form/Drop
// TODO we need a way to force a button contribution to look like a tool. This is a very rare case.
addImageToElement(this, element, name);
overClass = "commandImageOver";
+ // ensure there is accessible text describing this image
+ this._addAccessibleLabel(element);
}
this._setupActivateVisuals(element, element, activeCommandClass, inactiveCommandClass, overClass);
}
@@ -1102,6 +1101,16 @@ define(['require', 'dojo', 'dijit', 'orion/util', 'dijit/Menu', 'dijit/form/Drop
/*
* stateless helper
*/
+ _addAccessibleLabel: function(element) {
+ var label = this.name || this.tooltip;
+ if (label) {
+ dojo.attr(element, "aria-label", label);
+ }
+ },
+
+ /*
+ * stateless helper
+ */
_setupActivateVisuals: function(domNode, focusNode, activeCommandClass, inactiveCommandClass, overClass) {
if (inactiveCommandClass) {
dojo.addClass(domNode, inactiveCommandClass);