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

Unified Diff: Source/devtools/front_end/main/Main.js

Issue 397303002: DevTools: [Elements] Implement shortcut-based node cut-copy-pasting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add visual feedback for nodes in the clipboard Created 6 years, 5 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
Index: Source/devtools/front_end/main/Main.js
diff --git a/Source/devtools/front_end/main/Main.js b/Source/devtools/front_end/main/Main.js
index c58c6071429479210e040fc63732616d07ee69ea..12d8e0138d01e90fb392cbfb4d1ea981b279d6cb 100644
--- a/Source/devtools/front_end/main/Main.js
+++ b/Source/devtools/front_end/main/Main.js
@@ -543,6 +543,18 @@ WebInspector.Main.prototype = {
WebInspector.inspectorView.currentPanel()["handleCopyEvent"](event);
},
+ _documentCut: function(event)
+ {
+ if (WebInspector.inspectorView.currentPanel() && WebInspector.inspectorView.currentPanel()["handleCutEvent"])
aandrey 2014/07/18 05:30:05 extract WebInspector.inspectorView.currentPanel()
apavlov 2014/07/18 09:02:07 Done.
+ WebInspector.inspectorView.currentPanel()["handleCutEvent"](event);
+ },
+
+ _documentPaste: function(event)
+ {
+ if (WebInspector.inspectorView.currentPanel() && WebInspector.inspectorView.currentPanel()["handlePasteEvent"])
aandrey 2014/07/18 05:30:05 ditto
apavlov 2014/07/18 09:02:07 Done.
+ WebInspector.inspectorView.currentPanel()["handlePasteEvent"](event);
+ },
+
_contextMenuEventFired: function(event)
{
if (event.handled || event.target.classList.contains("popup-glasspane"))
@@ -554,6 +566,8 @@ WebInspector.Main.prototype = {
doc.addEventListener("keydown", this._postDocumentKeyDown.bind(this), false);
doc.addEventListener("beforecopy", this._documentCanCopy.bind(this), true);
doc.addEventListener("copy", this._documentCopy.bind(this), false);
+ doc.addEventListener("cut", this._documentCut.bind(this), false);
+ doc.addEventListener("paste", this._documentPaste.bind(this), false);
doc.addEventListener("contextmenu", this._contextMenuEventFired.bind(this), true);
doc.addEventListener("click", this._documentClick.bind(this), false);
},

Powered by Google App Engine
This is Rietveld 408576698