Index: Source/devtools/front_end/elements/ElementsPanel.js |
diff --git a/Source/devtools/front_end/elements/ElementsPanel.js b/Source/devtools/front_end/elements/ElementsPanel.js |
index 80db94ddc8b0efd12ed5f3d22869381324b95bb5..a39441a8416d3167e2331961265592903b210151 100644 |
--- a/Source/devtools/front_end/elements/ElementsPanel.js |
+++ b/Source/devtools/front_end/elements/ElementsPanel.js |
@@ -57,7 +57,6 @@ WebInspector.ElementsPanel = function() |
this.contentElement.classList.add("nowrap"); |
WebInspector.settings.domWordWrap.addChangeListener(this._domWordWrapSettingChanged.bind(this)); |
- this.contentElement.addEventListener("contextmenu", this._contextMenuEventFired.bind(this), true); |
this._splitView.sidebarElement().addEventListener("contextmenu", this._sidebarContextMenuEventFired.bind(this), false); |
var crumbsContainer = stackElement.createChild("div"); |
@@ -130,7 +129,7 @@ WebInspector.ElementsPanel.prototype = { |
*/ |
targetAdded: function(target) |
{ |
- var treeOutline = new WebInspector.ElementsTreeOutline(target, true, true, this._populateContextMenu.bind(this), this._setPseudoClassForNode.bind(this)); |
+ var treeOutline = new WebInspector.ElementsTreeOutline(target, true, true, this._setPseudoClassForNode.bind(this)); |
treeOutline.wireToDOMModel(); |
treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, this._selectedNodeChanged, this); |
treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.NodePicked, this._onNodePicked, this); |
@@ -451,16 +450,6 @@ WebInspector.ElementsPanel.prototype = { |
} |
}, |
- _contextMenuEventFired: function(event) |
- { |
- if (this.sidebarPanes.styles.isEditingSelector()) |
- return; |
- var contextMenu = new WebInspector.ContextMenu(event); |
- for (var i = 0; i < this._treeOutlines.length; ++i) |
- this._treeOutlines[i].populateContextMenu(contextMenu, event); |
- contextMenu.show(); |
- }, |
- |
_domWordWrapSettingChanged: function(event) |
{ |
if (event.data) |
@@ -485,14 +474,6 @@ WebInspector.ElementsPanel.prototype = { |
this.selectDOMNode(node, true); |
}, |
- _populateContextMenu: function(contextMenu, node) |
- { |
- // Add debbuging-related actions |
- contextMenu.appendSeparator(); |
- var pane = WebInspector.domBreakpointsSidebarPane; |
- pane.populateNodeContextMenu(node, contextMenu); |
- }, |
- |
/** |
* @param {!Element} element |
* @param {!Event} event |
@@ -1292,10 +1273,18 @@ WebInspector.ElementsPanel.prototype = { |
&& !(object instanceof WebInspector.DeferredDOMNode)) { |
return; |
} |
+ |
+ // Add debbuging-related actions |
+ if (object instanceof WebInspector.DOMNode) { |
+ contextMenu.appendSeparator(); |
+ WebInspector.domBreakpointsSidebarPane.populateNodeContextMenu(object, contextMenu); |
+ } |
+ |
// Skip adding "Reveal..." menu item for our own tree outline. |
if (this.element.isAncestor(/** @type {!Node} */ (event.target))) |
return; |
var commandCallback = WebInspector.Revealer.reveal.bind(WebInspector.Revealer, object); |
+ |
sergeyv
2014/09/24 16:17:29
extra line
pfeldman
2014/09/24 16:23:13
Acknowledged.
|
contextMenu.appendItem(WebInspector.useLowerCaseMenuTitles() ? "Reveal in Elements panel" : "Reveal in Elements Panel", commandCallback); |
}, |