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 501a9d689c841e2ed282d32782d4a41c0edf822a..dc7bf625b1969ab95943eaef10312af03c666ebd 100644 |
--- a/Source/devtools/front_end/documentation/DocumentationView.js |
+++ b/Source/devtools/front_end/documentation/DocumentationView.js |
@@ -50,18 +50,14 @@ WebInspector.DocumentationView.ContextMenuProvider.prototype = { |
if (!(target instanceof WebInspector.CodeMirrorTextEditor)) |
return; |
var textEditor = /** @type {!WebInspector.CodeMirrorTextEditor} */ (target); |
- contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Show documentation" : "Show Documentation"), this._showDocumentation.bind(this, textEditor)); |
- }, |
- |
- /** |
- * @param {!WebInspector.CodeMirrorTextEditor} textEditor |
- */ |
- _showDocumentation: function(textEditor) |
- { |
var selection = textEditor.selection(); |
- if (!selection || selection.isEmpty()) |
+ if (!selection || selection.isEmpty() || selection.startLine !== selection.endLine) |
return; |
var selectedText = textEditor.copyRange(selection); |
- WebInspector.DocumentationView.showSearchTerm(selectedText); |
+ 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)); |
} |
-} |
+} |