Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Unified Diff: third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js

Issue 1998723003: DevTools: add expand/collapse-subtree to context menu for DOM elements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address patch 1 comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js b/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js
index b17d173471329c880838a373e030ae8eab8f86c7..5c27d6a1d18a35d36f666e00755aeab4fae8e222 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js
@@ -545,16 +545,16 @@ WebInspector.ElementsTreeElement.prototype = {
var copyMenu = contextMenu.appendSubMenuItem(WebInspector.UIString("Copy"));
var createShortcut = WebInspector.KeyboardShortcut.shortcutToString;
var modifier = WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta;
+ var treeOutline = this.treeOutline;
var menuItem;
if (!isShadowRoot)
- menuItem = copyMenu.appendItem(WebInspector.UIString("Copy outerHTML"), this.treeOutline.performCopyOrCut.bind(this.treeOutline, false, this._node));
+ menuItem = copyMenu.appendItem(WebInspector.UIString("Copy outerHTML"), treeOutline.performCopyOrCut.bind(treeOutline, false, this._node));
menuItem.setShortcut(createShortcut("V", modifier));
if (this._node.nodeType() === Node.ELEMENT_NODE)
copyMenu.appendItem(WebInspector.UIString.capitalize("Copy selector"), this._copyCSSPath.bind(this));
if (!isShadowRoot)
copyMenu.appendItem(WebInspector.UIString("Copy XPath"), this._copyXPath.bind(this));
if (!isShadowRoot) {
- var treeOutline = this.treeOutline;
menuItem = copyMenu.appendItem(WebInspector.UIString("Cut element"), treeOutline.performCopyOrCut.bind(treeOutline, true, this._node), !this.hasEditableNode());
menuItem.setShortcut(createShortcut("X", modifier));
menuItem = copyMenu.appendItem(WebInspector.UIString("Copy element"), treeOutline.performCopyOrCut.bind(treeOutline, false, this._node));
@@ -564,13 +564,17 @@ WebInspector.ElementsTreeElement.prototype = {
}
contextMenu.appendSeparator();
- menuItem = contextMenu.appendCheckboxItem(WebInspector.UIString("Hide element"), this.treeOutline.toggleHideElement.bind(this.treeOutline, this._node), this.treeOutline.isToggledToHidden(this._node));
+ menuItem = contextMenu.appendCheckboxItem(WebInspector.UIString("Hide element"), treeOutline.toggleHideElement.bind(treeOutline, this._node), treeOutline.isToggledToHidden(this._node));
menuItem.setShortcut(WebInspector.shortcutRegistry.shortcutTitleForAction("elements.hide-element"));
if (isEditable)
contextMenu.appendItem(WebInspector.UIString("Delete element"), this.remove.bind(this));
contextMenu.appendSeparator();
+
+ contextMenu.appendItem(WebInspector.UIString("Expand all"), this.expandRecursively.bind(this));
+ contextMenu.appendItem(WebInspector.UIString("Collapse all"), this.collapseRecursively.bind(this));
+ contextMenu.appendSeparator();
},
_startEditing: function()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698