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

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

Issue 1844623002: [DevTools] Fixed context menu breakage when edit dom in console (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 3ac4a0d80efd8c80cc776dfda58dfde20df64d1d..d2de4a1e272e90de883a0a1def17eb9399afc5ab 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js
@@ -538,7 +538,7 @@ WebInspector.ElementsTreeElement.prototype = {
var openTagElement = this._node[this.treeOutline.treeElementSymbol()] || this;
var isEditable = this.hasEditableNode();
if (isEditable && !this._editing)
- contextMenu.appendAction("elements.edit-as-html", WebInspector.UIString("Edit as HTML"));
+ contextMenu.appendItem(WebInspector.UIString("Edit as HTML"), this._editAsHTML.bind(this));
var isShadowRoot = this._node.isShadowRoot();
// Place it here so that all "Copy"-ing items stick together.
@@ -1615,5 +1615,11 @@ WebInspector.ElementsTreeElement.prototype = {
this._node.resolveToObject("", scrollIntoViewCallback);
},
+ _editAsHTML: function ()
+ {
+ var promise = WebInspector.Revealer.revealPromise(this.node());
+ promise.then(() => WebInspector.actionRegistry.action("elements.edit-as-html").execute());
+ },
+
__proto__: TreeElement.prototype
}
« 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