Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Focus is not visible on some elements of the Web IDE pages #23

Merged
merged 1 commit into from
May 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,7 @@ define([
id = renderType + command.id + index; // // using the index ensures unique ids within the DOM when a command repeats for each item
element = Commands.createCommandItem(parent, command, invocation, id, null, renderType === "tool", onClick);
}
mNavUtils.generateNavGrid(domNodeWrapperList, element);
mNavUtils.generateNavGrid(domNodeWrapperList, element, null, null, true);
invocation.domNode = element;
index++;
}
Expand Down
57 changes: 31 additions & 26 deletions bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ define([
commandRegistry.registerCommandContribution(this.editToolbarId || this.pageNavId, "orion.edit.find", 0, this.editToolbarId ? "orion.menuBarEditGroup/orion.findGroup" : null, !this.editToolbarId, new mKeyBinding.KeyBinding('f', true), new mCommandRegistry.URLBinding("find", "find"), this); //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-5$
commandRegistry.registerCommandContribution(this.editToolbarId || this.pageNavId , "orion.edit.format", 2, this.editToolbarId ? "orion.menuBarEditGroup/orion.edit.formatGroup" : null, !this.editToolbarId, new mKeyBinding.KeyBinding('f', false, true, true), new mCommandRegistry.URLBinding("format", "format"), this); //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-5$
commandRegistry.registerCommandContribution(this.toolbarId, "orion.keyAssist", 0, "orion.menuBarToolsGroup", false, new mKeyBinding.KeyBinding(191, false, true, true)); //$NON-NLS-1$ //$NON-NLS-0$ //$NON-NLS-2$
commandRegistry.registerCommandContribution(this.toolbarId , "orion.edit.showTooltip", 1, "orion.menuBarToolsGroup", false, new mKeyBinding.KeyBinding(113), null, this);//$NON-NLS-1$ //$NON-NLS-2$
commandRegistry.registerCommandContribution(this.toolbarId , "orion.edit.showTooltip", 1, "orion.menuBarToolsGroup", false, null, null, this);//$NON-NLS-1$ //$NON-NLS-2$
commandRegistry.registerCommandContribution(this.toolbarId , "orion.edit.blame", 2, "orion.menuBarToolsGroup", false, new mKeyBinding.KeyBinding('b', true, true), new mCommandRegistry.URLBinding("blame", "blame"), this); //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-5$
commandRegistry.registerCommandContribution(this.toolbarId , "orion.edit.diff", 3, "orion.menuBarToolsGroup", false, new mKeyBinding.KeyBinding('d', true, true), new mCommandRegistry.URLBinding("diff", "diff"), this); //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-5$

Expand Down Expand Up @@ -984,31 +984,36 @@ define([
},

_createShowTooltipCommand: function(){
var that = this;
var showTooltipCommand = new mCommands.Command({
name: messages.showTooltip,
tooltip: messages.showTooltipTooltip,
id: "orion.edit.showTooltip", //$NON-NLS-0$
visibleWhen: /** @callback */ function(items, data) {
var editor = data.handler.editor || that.editor;
return editor && editor.installed;
},
callback: function() {
var editor = this.editor || that.editor;
var tooltip = editor.getTooltip();
var tv = editor.getTextView();
var offset = tv.getCaretOffset();
var pos = tv.getLocationAtOffset(offset);
tooltip.show({
x: pos.x,
y: pos.y,
getTooltipInfo: function() {
return editor._getTooltipInfo(this.x, this.y);
}
}, false, true);
}
});
this.commandService.addCommand(showTooltipCommand);
// var that = this;
// var showTooltipCommand = new mCommands.Command({
// name: messages.showTooltip,
// tooltip: messages.showTooltipTooltip,
// id: "orion.edit.showTooltip", //$NON-NLS-0$
// visibleWhen: /** @callback */ function(items, data) {
// var editor = data.handler.editor || that.editor;
// return editor && editor.installed;
// },
// callback: function() {
// var domFocus = document.activeElement;
// var editor = this.editor || that.editor;
// if (editor._domNode.contains(domFocus)) {
// var tooltip = editor.getTooltip();
// var tv = editor.getTextView();
// var offset = tv.getCaretOffset();
// var pos = tv.getLocationAtOffset(offset);
// tooltip.show({
// x: pos.x,
// y: pos.y,
// getTooltipInfo: function() {
// return editor._getTooltipInfo(this.x, this.y);
// }
// }, false, true);
// } else if (domFocus) {
//
// }
// }
// });
// this.commandService.addCommand(showTooltipCommand);
},
_onServiceRemoved: function(serviceReference) {
if (serviceReference.getProperty("objectClass").indexOf("orion.edit.command") !== -1) { //$NON-NLS-1$ //$NON-NLS-2$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@ define([], function() {
*/


function generateNavGrid(domNodeWrapperList, domNode, widget, onClick) {
function generateNavGrid(domNodeWrapperList, domNode, widget, onClick, hideOutline) {
if(isPad){
return;
}
if(!domNodeWrapperList){
return;
}
domNodeWrapperList.push({domNode: domNode});
domNode.style.outline = "none"; //$NON-NLS-0$
if (!hideOutline) {
domNode.style.outline = "none"; //$NON-NLS-0$
}

}

/**
Expand Down
34 changes: 33 additions & 1 deletion bundles/org.eclipse.orion.client.ui/web/orion/globalCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ define([
var dropdownTrigger = lib.node("userTrigger"); //$NON-NLS-0$
dropdownTrigger.setAttribute("aria-label", optionsLabel);

new mTooltip.Tooltip({
dropdownTrigger.tooltip = new mTooltip.Tooltip({
node: dropdownTrigger,
text: optionsLabel,
position: ["below", "left"] //$NON-NLS-1$ //$NON-NLS-0$
Expand Down Expand Up @@ -776,6 +776,38 @@ define([
commandRegistry.addCommand(operationsCommand);
commandRegistry.registerCommandContribution("globalActions", "orion.backgroundOperations", 100, null, true, new KeyBinding.KeyBinding('o', true, true)); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$

var showTooltipCommand = new mCommands.Command({
name: messages.showTooltip,
tooltip: messages.showTooltipTooltip,
id: "orion.edit.showTooltip", //$NON-NLS-0$
visibleWhen: /** @callback */ function(items, data) {
return true;
},
callback: function() {
var domFocus = document.activeElement;
if (this.editor && this.editor._domNode.contains(domFocus)) {
var editor = this.editor;
var tooltip = editor.getTooltip();
var tv = editor.getTextView();
var offset = tv.getCaretOffset();
var pos = tv.getLocationAtOffset(offset);
tooltip.show({
x: pos.x,
y: pos.y,
getTooltipInfo: function() {
return editor._getTooltipInfo(this.x, this.y);
}
}, false, true);
} else if (domFocus.commandTooltip || domFocus.tooltip) {
var tooltip = domFocus.commandTooltip ? domFocus.commandTooltip : domFocus.tooltip;
tooltip._showByKB = true;
tooltip.show();
}
}
});
commandRegistry.addCommand(showTooltipCommand);
commandRegistry.registerCommandContribution("globalActions" , "orion.edit.showTooltip", 1, null, true, new KeyBinding.KeyBinding(113), null, this);//$NON-NLS-1$

// Key assist
keyAssist = new mKeyAssist.KeyAssistPanel({
commandRegistry: commandRegistry
Expand Down
13 changes: 11 additions & 2 deletions bundles/org.eclipse.orion.client.ui/web/orion/progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,23 @@
* Contributors: IBM Corporation - initial API and implementation
*******************************************************************************/
/*eslint-env browser, amd*/
define(['i18n!orion/nls/messages', 'orion/webui/littlelib', 'orion/webui/dialogs/OperationsDialog'],
function(messages, lib, mOperationsDialog) {
define(['i18n!orion/nls/messages', 'orion/webui/littlelib', 'orion/webui/dialogs/OperationsDialog',
'orion/webui/tooltip',
],
function(messages, lib, mOperationsDialog, Tooltip) {

function ProgressMonitorTool(progressPane, commandRegistry){
if(this._progressPane){
return;
}
this._progressPane = lib.node(progressPane);

this._progressPane.tooltip = new Tooltip.Tooltip({
node: this._progressPane,
text: messages["Operations"],
position: ["above", "below", "right", "left"] //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
});

this._operationsDialog = new mOperationsDialog.OperationsDialog({triggerNode: this._progressPane, commandRegistry: commandRegistry});
var that = this;
this._progressPane.addEventListener("keydown", function(evt) { //$NON-NLS-0$
Expand Down
19 changes: 19 additions & 0 deletions bundles/org.eclipse.orion.client.ui/web/orion/webui/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ define(['orion/webui/littlelib'], function(lib) {
this._tip.classList.add("tooltipContainer"); //$NON-NLS-0$
this._tipInner = document.createElement("div"); //$NON-NLS-0$
this._tipInner.classList.add("tooltip"); //$NON-NLS-0$

if (this._text) {
this._tipTextContent = document.createElement("div"); //$NON-NLS-0$
this._tipTextContent.classList.add("textContent"); //$NON-NLS-0$
Expand All @@ -118,6 +119,17 @@ define(['orion/webui/littlelib'], function(lib) {
document.body.appendChild(this._tip);
var self = this;
lib.addAutoDismiss([this._tip, this._node], function() {self.hide();});

if (this._showByKB) {
this._tip.tabIndex = "1";
this._tip.addEventListener("keydown", function (e) {
if (e.keyCode === lib.KEY.ESCAPE) {
self._node.focus();
self.hide();
}
}, false);
}

if (this._trigger === "mouseover") { //$NON-NLS-0$
this._tipInner.setAttribute("role", "tooltip"); //$NON-NLS-2$ //$NON-NLS-1$
this._tipInner.id = "tooltip" + Date.now(); //$NON-NLS-0$
Expand Down Expand Up @@ -317,6 +329,11 @@ define(['orion/webui/littlelib'], function(lib) {
if (!positioned) {
this._positionTip(this._position[0], false, true); // force it in, it doesn't fit anywhere
}

if (this._showByKB) {
this._tip.focus();
}

if (this._afterShowing) {
this._afterShowing();
}
Expand All @@ -326,6 +343,8 @@ define(['orion/webui/littlelib'], function(lib) {
* Hide the tooltip.
*/
hide: function(hideDelay) {
this._showByKB = undefined;

if (this._timeout) {
window.clearTimeout(this._timeout);
this._timeout = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,11 @@
}

.launchConfigurationsWrapper > .dropdownMenu {
display: block;
padding-bottom: 0;
-webkit-transform: scaleY(0);
-ms-transform: scaleY(0);
transform: scaleY(0);
-webkit-transform-origin: top;
-ms-transform-origin: top;
transform-origin: top;
transition: transform 0.2s ease;
visibility: visible;
display: none;
}

.launchConfigurationsWrapper > .dropdownMenu.dropdownMenuOpen {
min-width: 300px;
-webkit-transform: scaleY(1);
-ms-transform: scaleY(1);
transform: scaleY(1);
display: block;
}

.launchConfigurationMenuItem > .dropdownMenuItem {
Expand Down