summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorGabriel Luong2013-05-23 10:01:46 (EDT)
committer Mark Macdonald2013-06-03 16:35:32 (EDT)
commit7d0dcbde2bca6db94db8ca53a27f8d3a3e63b050 (patch)
tree86721719aabc9baaadc485ba7410dcb33b5779a2
parentb009482f8fc576c9c480f0162a58f25a17caeef4 (diff)
downloadorg.eclipse.orion.client-7d0dcbde2bca6db94db8ca53a27f8d3a3e63b050.zip
org.eclipse.orion.client-7d0dcbde2bca6db94db8ca53a27f8d3a3e63b050.tar.gz
org.eclipse.orion.client-7d0dcbde2bca6db94db8ca53a27f8d3a3e63b050.tar.bz2
Bug 408191 - oldRelatedLinks should be removed
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/css/ide.css4
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/orion/banner/banner.html4
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/orion/globalCommands.js63
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/orion/widgets/input/GroupedContent.js2
4 files changed, 8 insertions, 65 deletions
diff --git a/bundles/org.eclipse.orion.client.ui/web/css/ide.css b/bundles/org.eclipse.orion.client.ui/web/css/ide.css
index 9a1778b..c35ed6c 100644
--- a/bundles/org.eclipse.orion.client.ui/web/css/ide.css
+++ b/bundles/org.eclipse.orion.client.ui/web/css/ide.css
@@ -800,10 +800,6 @@ input {
}
-.oldRelatedLinks {
- display: none;
-}
-
.navigationLabel{
color:#ddd;
cursor:pointer;
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/banner/banner.html b/bundles/org.eclipse.orion.client.ui/web/orion/banner/banner.html
index 1b4d48e..9c24a3f 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/banner/banner.html
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/banner/banner.html
@@ -11,10 +11,6 @@
</div>
<div class="bannerRightArea">
<div id="globalActions" class="spacingLeft layoutLeft"></div>
- <div id="oldRelatedLinks" class="spacingLeft layoutLeft oldRelatedLinks">
- <span tabindex="0" role="button" id="relatedTrigger" class="dropdownTrigger hidden">${Related}<span class="dropdownArrowDown"></span></span>
- <ul id="relatedDropdown" class="dropdownMenu" role="menu"></ul>
- </div>
<input type="text" id="search" autocomplete="off" class="layoutLeft spacingLeft searchbox" role="search" style="display:none;">
<div id="searchOptions" class="layoutLeft" style="padding-top:1px;display:none;"></div>
<div id="userMenu" class="spacingRight layoutRight" style="color:#ccc;">
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/globalCommands.js b/bundles/org.eclipse.orion.client.ui/web/orion/globalCommands.js
index e2ae0d1..71ff9df 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/globalCommands.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/globalCommands.js
@@ -184,65 +184,24 @@ define(['i18n!orion/nls/messages', 'require', 'orion/commonHTMLFragments', 'orio
// Related links menu management. The related menu is reused as content changes. If the menu becomes
// empty, we hide the dropdown.
- var linksDropdown;
var pageItem;
var exclusions = [];
var title;
- function _emptyLinksMenu() {
- var related = lib.node("oldRelatedLinks"); //$NON-NLS-0$
- if(!related){
- // document not loaded
- return;
- }
- if (linksDropdown) {
- linksDropdown.close();
- linksDropdown.empty();
- }
- }
-
- function _checkForEmptyLinksMenu() {
- var triggerNode = lib.node("relatedTrigger"); //$NON-NLS-0$
- if (linksDropdown && triggerNode) {
- if (linksDropdown.getItems().length === 0) {
- triggerNode.style.visibility = "hidden"; //$NON-NLS-0$
- } else {
- triggerNode.style.visibility = "visible"; //$NON-NLS-0$
- }
- }
+ function _addRelatedLinkCommand(command, invocation) {
+ var relatedLinksNode = lib.node('relatedLinks');
+ var newRelatedLinkItem = mCommands.createCommandMenuItem(relatedLinksNode, command, invocation);
+ newRelatedLinkItem.classList.remove('dropdownMenuItem');
}
- function _addRelatedLinkCommand(command, invocation) {
- var dropdownNode = lib.node("relatedDropdown"); //$NON-NLS-0$
-
- /* Evolving to a compound list of navigation and related links
- Some of this code was dedicated to the older dropdown. Will
- clean this up as a next step.
- */
- if (!linksDropdown) {
- linksDropdown = new mDropdown.Dropdown({
- dropdown: dropdownNode
- });
- }
-
- mCommands.createCommandMenuItem(dropdownNode, command, invocation);
-
- var relatedlinks = lib.node('relatedlinks');
- var link = mCommands.createCommandMenuItem(dropdownNode, command, invocation);
- link.className = '';
- var li = document.createElement( 'li' );
- li.appendChild(link);
- relatedlinks.appendChild(li);
- }
/**
* Adds the related links to the banner
* @name orion.globalCommands#generateRelatedLinks
* @function
*/
function generateRelatedLinks(serviceRegistry, item, exclusions, commandRegistry, alternateItem) {
-
- var relatedlinks = lib.node('relatedlinks');
- lib.empty( relatedlinks );
+ var relatedLinksNode = lib.node('relatedLinks');
+ lib.empty(relatedLinksNode);
var contentTypesCache;
function getContentTypes() {
@@ -265,15 +224,9 @@ define(['i18n!orion/nls/messages', 'require', 'orion/commonHTMLFragments', 'orio
if (contributedLinks.length <= 0) {
return;
}
- var related = lib.node("oldRelatedLinks"); //$NON-NLS-0$
- if(!related){
- // document not loaded
- return;
- }
Deferred.when(getContentTypes(), function() {
var alternateItemDeferred;
- _emptyLinksMenu();
var deferreds = [];
// assemble the related links
@@ -354,9 +307,7 @@ define(['i18n!orion/nls/messages', 'require', 'orion/commonHTMLFragments', 'orio
}
}
}
- Deferred.all(deferreds, function(error) { return error; }).then(function(){
- _checkForEmptyLinksMenu();
- });
+ Deferred.all(deferreds, function(error) { return error; });
});
}
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/input/GroupedContent.js b/bundles/org.eclipse.orion.client.ui/web/orion/widgets/input/GroupedContent.js
index 0c5f3a2..c6f95a7 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/input/GroupedContent.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/widgets/input/GroupedContent.js
@@ -36,7 +36,7 @@ define(['orion/objects', 'orion/webui/littlelib'], function(objects, lib) {
'<section>' +
'<span style="color:#333;padding:15px;">Related Links</span>' +
'<nav>' +
- '<ul id="relatedlinks">' +
+ '<ul id="relatedLinks">' +
'</ul>' +
'</nav>' +
'</section>' +