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..f8a06cc881b3d9f5fa337882aaafe74fac7c8631 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,11 @@ 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) |
apavlov
2014/08/12 15:35:45
if (!possibleProperties.length)
return;
semeny
2014/08/12 15:44:49
Done.
|
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 15:35:46
a submenu should only be present when there are mu
semeny
2014/08/12 15:44:49
Done.
|
+ for (var i = 0; i < possibleProperties.length; ++i) |
+ subMenuItem.appendItem(String.sprintf("%s.%s", possibleProperties[i].name, selectedText), WebInspector.DocumentationView.showDocumentationURL.bind(null, possibleProperties[i].url)); |
} |
-} |
+} |