aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorelijahe2013-12-17 11:41:26 (EST)
committerAnton McConville2013-12-17 12:05:36 (EST)
commit26f10828379790223611d8f2694b1743d36f4c21 (patch)
treea66aa6c0735e82c1b7bf44bf285e821cea605295
parent38dcc66b705f837637adb0ad20ac1e652aa0a2e9 (diff)
downloadorg.eclipse.orion.client-26f10828379790223611d8f2694b1743d36f4c21.zip
org.eclipse.orion.client-26f10828379790223611d8f2694b1743d36f4c21.tar.gz
org.eclipse.orion.client-26f10828379790223611d8f2694b1743d36f4c21.tar.bz2
Bug 424247 - Remove the downward arrow from the context menu
--Signed-off-by: Elijah El-Haddad <elijahe@ca.ibm.com>
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/css/theme.css12
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/orion/webui/browsercontextmenubutton.html5
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/orion/webui/contextmenu.js89
3 files changed, 3 insertions, 103 deletions
diff --git a/bundles/org.eclipse.orion.client.ui/web/css/theme.css b/bundles/org.eclipse.orion.client.ui/web/css/theme.css
index 1d5cc1d..51286ba 100644
--- a/bundles/org.eclipse.orion.client.ui/web/css/theme.css
+++ b/bundles/org.eclipse.orion.client.ui/web/css/theme.css
@@ -433,18 +433,6 @@ a.currentLocation:hover {
border: 1px solid #ccc !important;
}
-button.browserContextButton { /* specifying <button> element to increase specificity and override .dropdownMenuItem's padding */
- border: none;
- width: 100%;
- text-align: center;
- padding: 0;
- background: none;
-}
-
-span.browserContextButton {
- line-height: 0; /* remove the extra padding from the open arrow icon */
-}
-
.checkedMenuItem {
margin: 4px 6px 2px 0;
vertical-align: bottom;
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/webui/browsercontextmenubutton.html b/bundles/org.eclipse.orion.client.ui/web/orion/webui/browsercontextmenubutton.html
deleted file mode 100644
index 8c34c5c..0000000
--- a/bundles/org.eclipse.orion.client.ui/web/orion/webui/browsercontextmenubutton.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<li class="dropdownSubMenu">
- <button class="dropdownMenuItem browserContextButton" tabindex="0">
- <span class="modelDecorationSprite core-sprite-openarrow browserContextButton"></span>
- </button>
-</li> \ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/webui/contextmenu.js b/bundles/org.eclipse.orion.client.ui/web/orion/webui/contextmenu.js
index afe96f6..b058123 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/webui/contextmenu.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/webui/contextmenu.js
@@ -16,9 +16,8 @@ define([
'orion/objects',
'orion/webui/tooltip',
'i18n!orion/nls/messages',
- 'text!orion/webui/dropdownseparator.html',
- 'text!orion/webui/browsercontextmenubutton.html'
-], function(lib, mDropdown, objects, Tooltip, messages, DropdownSeparatorFragment, BrowserContextMenuFragment) {
+ 'text!orion/webui/dropdownseparator.html'
+], function(lib, mDropdown, objects, Tooltip, messages, DropdownSeparatorFragment) {
var Dropdown = mDropdown.Dropdown;
@@ -59,8 +58,6 @@ define([
//clicking on the trigger node should close the context menu
this._triggerNode.addEventListener("click", this._boundContextMenuCloser, false);//$NON-NLS-0$
-
- this.addEventListener("postpopulate", this._addBrowserContextMenuArrow.bind(this)); //$NON-NLS-0$
},
_positionContextMenu: function(event) {
@@ -103,67 +100,7 @@ define([
} else {
this.close();
}
- },
-
- _addBrowserContextMenuArrow: function(eventWrapper) {
- var self = this;
-
- if (this._separatorElement) {
- this._dropdownNode.appendChild(this._separatorElement);
- } else {
- var separatorRange = document.createRange();
- separatorRange.selectNode(this._dropdownNode);
- var separatorFragment = separatorRange.createContextualFragment(DropdownSeparatorFragment);
- this._dropdownNode.appendChild(separatorFragment);
- this._separatorElement = this._dropdownNode.lastChild;
- }
-
- if (this._browserContextNode) {
- this._dropdownNode.appendChild(this._browserContextNode);
- } else {
- var browserContextRange = document.createRange();
- browserContextRange.selectNode(this._dropdownNode);
- var browserContextMenuFragment = browserContextRange.createContextualFragment(BrowserContextMenuFragment);
- this._dropdownNode.appendChild(browserContextMenuFragment);
-
- this._browserContextNode = this._dropdownNode.lastChild;
-
- var browserContextButtonNode = this._browserContextNode.firstElementChild;
-
- this._browserContextTooltip = new Tooltip.Tooltip({
- node: browserContextButtonNode,
- text: messages["To view the browser's context menu, trigger the context menu again."], //$NON-NLS-0$
- position: ["below", "right", "left", "above"], //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
- trigger: "none" //$NON-NLS-0$
- });
-
- // add handler to show tooltip
- browserContextButtonNode.addEventListener("click", function(e){ //$NON-NLS-0$
- self._browserContextTooltip.show();
- }, false);
-
- browserContextButtonNode.addEventListener("keyup", function(e){ //$NON-NLS-0$
- if (e.which || e.keyCode) {
- if ((e.which === lib.KEY.ENTER) || (e.keyCode === lib.KEY.ENTER)) {
- self._browserContextTooltip.show();
- return false;
- }
- }
- });
-
- // add handler to close submenu
- browserContextButtonNode.addEventListener("mouseover", function(e){ //$NON-NLS-0$
- self._closeSelectedSubmenu();
- }, false);
-
- }
- },
-
- _hideBrowserContextTooltip: function() {
- if (this._browserContextTooltip) {
- this._browserContextTooltip.hide(0);
- }
- }
+ },
});
ContextMenu.prototype.constructor = ContextMenu;
@@ -179,32 +116,12 @@ define([
return actionTaken;
};
- // overrides Dropdown.protoype.submenuOpen
- ContextMenu.prototype.submenuOpen = function(submenu) {
- Dropdown.prototype.submenuOpen.call(this, submenu); //call function in super class
- this._hideBrowserContextTooltip();
- };
-
- // overrides Dropdown.protoype.submenuOpen
- ContextMenu.prototype.close = function(restoreFocus) {
- Dropdown.prototype.close.call(this, restoreFocus); //call function in super class
- this._hideBrowserContextTooltip();
- };
-
// overrides Dropdown.protoype.destroy
ContextMenu.prototype.destroy = function() {
this._triggerNode.removeEventListener("contextmenu", this._boundcontextmenuEventHandler, true); //$NON-NLS-0$
this._triggerNode.removeEventListener("click", this._boundContextMenuCloser, false); //$NON-NLS-0$
window.removeEventListener("contextmenu", this._boundContextMenuCloser, false); //$NON-NLS-0$
this._dropdownNode.dropdown = null;
- if (this._browserContextNode) {
- this._dropdownNode.removeChild(this._browserContextNode);
- this._browserContextNode = null;
- }
- if (this._browserContextTooltip) {
- this._browserContextTooltip.destroy();
- this._browserContextTooltip = null;
- }
Dropdown.prototype.destroy.call(this); //call function in super class
};