Chromium Code Reviews| 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..949260858ec94e037f1de81b6404eb536ff4f3b5 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) |
| - return; |
| - contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Show documentation" : "Show Documentation"), WebInspector.DocumentationView.showSearchTerm.bind(null, selectedText)); |
| + var possibleProperties = urlProvider.itemDescriptors(selectedText); |
| + for (var i = 0; i < possibleProperties.length; ++i) { |
| + var formatString = WebInspector.useLowerCaseMenuTitles() ? "Show documentation for '%s'" : "Show Documentation for '%s'"; |
|
lushnikov
2014/08/12 13:21:06
this should be moved out of for-loop
semeny
2014/08/12 14:27:59
Done.
|
| + var contextMenuItemTitle = WebInspector.UIString(formatString, possibleProperties[i].name); |
| + contextMenu.appendItem(contextMenuItemTitle, WebInspector.DocumentationView.showDocumentationURL.bind(null, possibleProperties[i].url)); |
|
lushnikov
2014/08/12 13:21:06
this doesn't add into context menu submenu, does i
semeny
2014/08/12 14:27:59
Done.
|
| + } |
| } |
| } |