summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMark Macdonald2012-10-19 11:19:57 (EDT)
committer skaegi2012-10-19 11:46:56 (EDT)
commit1edee2edc659df5f41104dac656c1333140ff55a (patch)
treec8396531bb558ac4d5d2bf9c3110ba0f9ce566c6
parente814301a379311d3f929b46d0c4bcee454715bbe (diff)
downloadorg.eclipse.orion.client-1edee2edc659df5f41104dac656c1333140ff55a.zip
org.eclipse.orion.client-1edee2edc659df5f41104dac656c1333140ff55a.tar.gz
org.eclipse.orion.client-1edee2edc659df5f41104dac656c1333140ff55a.tar.bz2
Bug 392442 - Command menus with embedded HTML don't display correctly
-rw-r--r--bundles/org.eclipse.orion.client.core/web/orion/globalCommands.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/globalCommands.js b/bundles/org.eclipse.orion.client.core/web/orion/globalCommands.js
index c595fbf..51d317a 100644
--- a/bundles/org.eclipse.orion.client.core/web/orion/globalCommands.js
+++ b/bundles/org.eclipse.orion.client.core/web/orion/globalCommands.js
@@ -158,6 +158,13 @@ define(['i18n!orion/nls/messages', 'require', 'dojo', 'dijit', 'orion/commonHTML
});
});
}
+
+ function createSearchLink(query, name) {
+ var link = document.createElement("a"); //$NON-NLS-0$
+ link.href = require.toUrl("search/search.html") + "#" + query; //$NON-NLS-1$ //$NON-NLS-0$
+ link.textContent = name;
+ return link;
+ }
function _addSearchOptions(serviceRegistry, commandService, searcher, openInNewTab) {
var optionMenu = dijit.byId("searchOptionsDropDown"); //$NON-NLS-0$
@@ -190,12 +197,11 @@ define(['i18n!orion/nls/messages', 'require', 'dojo', 'dijit', 'orion/commonHTML
//Add the recent searches as popups
_addSearchPopUp(newMenu, messages["Recent searches"], serviceRegistry, "recentSearch", function(theSearch){
- var query = searcher.createSearchQuery(theSearch.name, false, null, false, null, theSearch.regEx);
- return "<a href='"+require.toUrl("search/search.html") + "#" + query + "'>" + theSearch.name+"</a>"; //$NON-NLS-4$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ return createSearchLink(searcher.createSearchQuery(theSearch.name, false, null, false, null, theSearch.regEx), theSearch.name);
});
//Add the saved searches as popups
_addSearchPopUp(newMenu, messages["Saved searches"], serviceRegistry, "search", function(theSearch){
- return "<a href='"+require.toUrl("search/search.html") + "#" + theSearch.query + "'>" + theSearch.name+"</a>"; //$NON-NLS-4$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ return createSearchLink(theSearch.query, theSearch.name);
});
var menuButton = new orion.widgets.UserMenuDropDown({