Skip to content

Commit

Permalink
Bug 371819 - platform vs. dojo tooltips, accessibility labels
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Li committed Feb 22, 2012
1 parent bc28ce8 commit f16400f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
10 changes: 9 additions & 1 deletion bundles/org.eclipse.orion.client.core/web/orion/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ define(['require', 'dojo', 'dijit', 'orion/util', 'dijit/Menu', 'dijit/form/Drop
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() {
Expand Down Expand Up @@ -676,11 +683,12 @@ define(['require', 'dojo', 'dijit', 'orion/util', 'dijit/Menu', 'dijit/form/Drop
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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++){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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){
Expand All @@ -202,15 +207,13 @@ 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");
});
})(key);
}else if(authService.login){
var a = dojo.create("a", {innerHTML: "Sign In",
title: "Sign In",
style: "margin-right: 0px"
}, dojo.byId('userInfo'), "only");

Expand Down

0 comments on commit f16400f

Please sign in to comment.