aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorelijahe2013-12-06 13:14:44 (EST)
committerSilenio Quarti2013-12-06 17:27:48 (EST)
commit1f3b5a7066967c4da883641f88776371f896c23a (patch)
treed461cd814f4bf5a2ed4a6024eb74f9fdd106dd29
parentce39a5089dbb49278f7ba365a5af4155e14458a5 (diff)
downloadorg.eclipse.orion.client-1f3b5a7066967c4da883641f88776371f896c23a.zip
org.eclipse.orion.client-1f3b5a7066967c4da883641f88776371f896c23a.tar.gz
org.eclipse.orion.client-1f3b5a7066967c4da883641f88776371f896c23a.tar.bz2
Bug 423386 - Sidebar resizing in a filtered outline mode causes 'View' menu button to disappear
--Signed-off-by: Elijah El-Haddad <elijahe@ca.ibm.com>
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/edit/common.css3
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/orion/outliner.js36
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/orion/sidebar.js12
3 files changed, 43 insertions, 8 deletions
diff --git a/bundles/org.eclipse.orion.client.ui/web/edit/common.css b/bundles/org.eclipse.orion.client.ui/web/edit/common.css
index bca9b46..15808e1 100644
--- a/bundles/org.eclipse.orion.client.ui/web/edit/common.css
+++ b/bundles/org.eclipse.orion.client.ui/web/edit/common.css
@@ -17,7 +17,8 @@
.outlineFilter {
border: 1px solid lightgrey;
margin: 4px;
- width: 250px;
+ width: 210px;
+ position: absolute;
}
.outlineRowMatchesFilter {
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/outliner.js b/bundles/org.eclipse.orion.client.ui/web/orion/outliner.js
index a394128..bdda37c 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/outliner.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/outliner.js
@@ -21,8 +21,9 @@ define([
'orion/URITemplate',
'orion/EventTarget',
'orion/i18nUtil',
- 'orion/edit/editorContext'
-], function(messages, Deferred, lib, mUIUtils, mSection, mExplorer, mCommands, URITemplate, EventTarget, i18nUtil, EditorContext) {
+ 'orion/edit/editorContext',
+ 'orion/webui/tooltip'
+], function(messages, Deferred, lib, mUIUtils, mSection, mExplorer, mCommands, URITemplate, EventTarget, i18nUtil, EditorContext, Tooltip) {
function OutlineRenderer (options, explorer, title, selectionService) {
this.explorer = explorer;
@@ -414,13 +415,16 @@ define([
this.explorer.destroy();
this.explorer = null;
}
+
+ //reset the sidebar switcher node's layout state
+ this._sidebar.switcherNode.classList.remove("layoutLeft");
+ this._sidebar.switcherNode.classList.add("layoutRight");
},
_createFilterInput: function() {
var input = document.createElement("input"); //$NON-NLS-0$
input.classList.add("outlineFilter"); //$NON-NLS-0$
- input.classList.add("layoutLeft"); //$NON-NLS-0$
input.placeholder = messages["Filter"]; //$NON-NLS-0$
input.type="text"; //$NON-NLS-0$
input.addEventListener("input", function (e) { //$NON-NLS-0$
@@ -449,8 +453,34 @@ define([
}
}
}.bind(this), false);
+
+ input.commandTooltip = new Tooltip.Tooltip({
+ node: input,
+ text: messages["Filter"], //$NON-NLS-0$
+ position: ["right", "above", "left"], //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ trigger: "none" //$NON-NLS-0$
+ });
+
+ // add handlers to show/hide tooltip
+ var showTooltip = function(e){
+ input.commandTooltip.show();
+ };
+ var hideTooltip = function(e){
+ input.commandTooltip.hide(0);
+ };
+ input.addEventListener("mouseover", showTooltip, false);
+ input.addEventListener("mouseout", function(e) {
+ if (input !== document.activeElement) {
+ hideTooltip();
+ }
+ }, false);
+ input.addEventListener("focus", showTooltip, false);
+ input.addEventListener("blur", hideTooltip, false);
this._toolbar.appendChild(input);
+ //move the sidebar's switcher node to the left
+ this._sidebar.switcherNode.classList.remove("layoutRight");
+ this._sidebar.switcherNode.classList.add("layoutLeft");
},
/**
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/sidebar.js b/bundles/org.eclipse.orion.client.ui/web/orion/sidebar.js
index 4317303..ed9bf7d 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/sidebar.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/sidebar.js
@@ -63,16 +63,20 @@ define(['orion/Deferred', 'orion/objects', 'orion/commands', 'orion/outliner', '
var toolbarNode = this.toolbarNode;
// Create toolbar contribution area for use by viewmodes
- var modeContributionToolbar = this.modeContributionToolbar = document.createElement("div"); //$NON-NLS-0$
- modeContributionToolbar.id = toolbarNode.id + "childModes"; //$NON-NLS-0$
- toolbarNode.appendChild(modeContributionToolbar);
var switcherNode = this.switcherNode = document.createElement("ul"); //$NON-NLS-0$
switcherNode.id = toolbarNode.id + "viewmodeSwitch"; //$NON-NLS-0$
switcherNode.classList.add("layoutRight"); //$NON-NLS-0$
switcherNode.classList.add("commandList"); //$NON-NLS-0$
switcherNode.classList.add("pageActions"); //$NON-NLS-0$
toolbarNode.appendChild(switcherNode);
-
+
+ // switcher node is more essential for navigation it should therefore
+ // be inserted first to prevent it from being considered as part of the
+ // overflow before the modeContributionToolbar
+ var modeContributionToolbar = this.modeContributionToolbar = document.createElement("div"); //$NON-NLS-0$
+ modeContributionToolbar.id = toolbarNode.id + "childModes"; //$NON-NLS-0$
+ toolbarNode.appendChild(modeContributionToolbar);
+
var changeViewModeCommand = new mCommands.Command({
name: messages["View"],
imageClass: "core-sprite-outline", //$NON-NLS-0$