| author | Max Li | 2012-03-08 13:04:33 (EST) |
|---|---|---|
| committer | sfranklin | 2012-03-08 13:04:33 (EST) |
| commit | 20ef0b9e8660315fc46290ced344605e57ba450e (patch) (side-by-side diff) | |
| tree | ad4f4f7eeac0066cb05b39d9b53c5fe025f0349d | |
| parent | 4b3464dfd7e2d9d38ae2bb461bcabeb8e771f346 (diff) | |
| download | org.eclipse.orion.client-20ef0b9e8660315fc46290ced344605e57ba450e.zip org.eclipse.orion.client-20ef0b9e8660315fc46290ced344605e57ba450e.tar.gz org.eclipse.orion.client-20ef0b9e8660315fc46290ced344605e57ba450e.tar.bz2 | |
Bug 371819 - platform vs. dojo tooltips, accessibility labels
3 files changed, 28 insertions, 10 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 86343b9..c7088bd 100644 --- a/bundles/org.eclipse.orion.client.core/web/orion/commands.js +++ b/bundles/org.eclipse.orion.client.core/web/orion/commands.js @@ -117,6 +117,13 @@ define(['require', 'dojo', 'dijit', 'orion/util', 'orion/PageUtil', 'dijit/Menu' this.inherited(arguments); this.polling = true; this.pollForMissingTarget(); + + // Override the dijit default ARIA role of alert, which causes undesirable behaviour. + window.setTimeout(function() { + if(dijit._masterTT) { + dojo.removeAttr(dijit._masterTT.containerNode, "role"); + } + }, this.showDelay + 1); }, pollForMissingTarget: function() { @@ -650,11 +657,12 @@ define(['require', 'dojo', 'dijit', 'orion/util', 'orion/PageUtil', 'dijit/Menu' dropDown: newMenu }); dojo.addClass(menuButton.domNode, "commandMenu"); + dojo.removeAttr(menuButton.titleNode, "title"); // there is no need for a native browser tooltip dojo.destroy(menuButton.valueNode); // the valueNode gets picked up by screen readers; since it's not used, we can get rid of it if (group.title === "*") { dojo.addClass(menuButton.domNode, "textless"); new CommandTooltip({ - connectId: [menuButton.domNode], + connectId: [menuButton.focusNode], label: "Actions menu", position: ["above", "left", "right", "below"], // otherwise defaults to right and obscures adjacent commands commandParent: parent, 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 4811646..c73d2e6 100644 --- a/bundles/org.eclipse.orion.client.core/web/orion/globalCommands.js +++ b/bundles/org.eclipse.orion.client.core/web/orion/globalCommands.js @@ -79,12 +79,19 @@ define(['require', 'dojo', 'dijit', 'orion/commonHTMLFragments', 'orion/commands dropDown: userMenu, label: "Options", showLabel: false, - alt: "Options" }); dojo.place(menuButton.domNode, userMenuPlaceholder, "only"); if(menuButton.valueNode) { dojo.destroy(menuButton.valueNode); } + if(menuButton.titleNode && dojo.attr(menuButton.titleNode, "title")) { + dojo.removeAttr(menuButton.titleNode, "title"); + } + new mCommands.CommandTooltip({ + connectId: [menuButton.focusNode], + label: "Options", + position: ["above", "left", "right", "below"], // otherwise defaults to right and obscures adjacent commands + }); } for(var i=0; i<authServices.length; i++){ diff --git a/bundles/org.eclipse.orion.client.core/web/orion/widgets/UserMenu.js b/bundles/org.eclipse.orion.client.core/web/orion/widgets/UserMenu.js index 63a8241..40f5226 100644 --- a/bundles/org.eclipse.orion.client.core/web/orion/widgets/UserMenu.js +++ b/bundles/org.eclipse.orion.client.core/web/orion/widgets/UserMenu.js @@ -9,7 +9,7 @@ * Contributors: IBM Corporation - initial API and implementation
******************************************************************************/
-define(['require', 'dojo', 'dijit', 'orion/util', 'dijit/Menu'], function(require, dojo, dijit, mUtil) {
+define(['require', 'dojo', 'dijit', 'orion/commands', 'orion/util', 'dijit/Menu'], function(require, dojo, dijit, mCommands, mUtil) {
dojo.declare("orion.widgets.UserMenu", [dijit.Menu], {
widgetsInTemplate: false,
id: "userMenu",
@@ -186,11 +186,16 @@ define(['require', 'dojo', 'dijit', 'orion/util', 'dijit/Menu'], function(requir var displayName = userName;
if(displayName.length > 40)
displayName = displayName.substring(0, 30) + "...";
- dojo.create("a", {innerHTML: displayName,
- href: require.toUrl("profile/user-profile.html") + "#" + jsonData.Location,
- title: "View profile of " + userName,
- style: "margin-right: 0px"
- }, dojo.byId('userInfo'), "only");
+ var profileLink = dojo.create("a", {innerHTML: displayName,
+ href: require.toUrl("profile/user-profile.html") + "#" + jsonData.Location,
+ "aria-label": "View profile of " + userName,
+ style: "margin-right: 0px"
+ }, dojo.byId('userInfo'), "only");
+ new mCommands.CommandTooltip({
+ connectId: [profileLink],
+ label: "View profile of " + userName,
+ position: ["above", "left", "right", "below"], // otherwise defaults to right and obscures adjacent commands
+ });
}else if(this.isSingleService() && !jsonData){
if(authService.getAuthForm){
dojo.hitch(this, function(key){
@@ -202,7 +207,6 @@ define(['require', 'dojo', 'dijit', 'orion/util', 'dijit/Menu'], function(requir }
dojo.create("a", {innerHTML: "Sign In",
href: loginForm,
- title: "Sign In",
style: "margin-right: 0px",
target: "_blank"
}, dojo.byId('userInfo'), "only");
@@ -210,7 +214,6 @@ define(['require', 'dojo', 'dijit', 'orion/util', 'dijit/Menu'], function(requir })(key);
}else if(authService.login){
var a = dojo.create("a", {innerHTML: "Sign In",
- title: "Sign In",
style: "margin-right: 0px"
}, dojo.byId('userInfo'), "only");
|

