Index: Source/devtools/front_end/documentation/DocumentationView.js |
diff --git a/Source/devtools/front_end/documentation/DocumentationView.js b/Source/devtools/front_end/documentation/DocumentationView.js |
index b3a440902d32712909c36ec74fdc36366db13c0f..9e578a209c5e7a3296ab7186e509f539779980a4 100644 |
--- a/Source/devtools/front_end/documentation/DocumentationView.js |
+++ b/Source/devtools/front_end/documentation/DocumentationView.js |
@@ -12,9 +12,9 @@ WebInspector.DocumentationView = function() |
} |
/** |
- * @param {string} searchTerm |
+ * @param {string} url |
*/ |
-WebInspector.DocumentationView.showSearchTerm = function(searchTerm) |
+WebInspector.DocumentationView.showDocumentationURL = function(url) |
{ |
if (!WebInspector.DocumentationView._view) |
WebInspector.DocumentationView._view = new WebInspector.DocumentationView(); |
@@ -50,9 +50,13 @@ WebInspector.DocumentationView.ContextMenuProvider.prototype = { |
return; |
var selectedText = textEditor.copyRange(selection); |
var urlProvider = new WebInspector.DocumentationURLProvider(); |
- var itemPath = urlProvider.itemPath(selectedText); |
- if (!itemPath) |
+ var possibleProperties = urlProvider.itemDescriptors(selectedText); |
+ if (possibleProperties.length === 0) |
return; |
- contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Show documentation" : "Show Documentation"), WebInspector.DocumentationView.showSearchTerm.bind(null, selectedText)); |
+ var subMenuItem = contextMenu.appendSubMenuItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Show documentation for" : "Show Documentation for")); |
apavlov
2014/08/12 14:45:16
You have lost the search term part here. Please re
apavlov
2014/08/12 14:50:45
Alternatively, you can display "Show documentation
semeny
2014/08/12 15:28:11
Done.
|
+ for (var i = 0; i < possibleProperties.length; ++i) { |
+ var contextMenuItemTitle = WebInspector.UIString(possibleProperties[i].name); |
apavlov
2014/08/12 14:45:16
The property names are not localizable (cannot be
semeny
2014/08/12 15:28:11
Done.
|
+ subMenuItem.appendItem(contextMenuItemTitle, WebInspector.DocumentationView.showDocumentationURL.bind(null, possibleProperties[i].url)); |
+ } |
} |
} |