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

Unified Diff: Source/devtools/front_end/sdk/DOMModel.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/sdk/DOMModel.js
diff --git a/Source/devtools/front_end/sdk/DOMModel.js b/Source/devtools/front_end/sdk/DOMModel.js
index 32d38ed80432bc8fe7267a12f5db2d158c107d7e..d25de9a81c2d2129fb374921b5e5ecf0e8e2e48a 100644
--- a/Source/devtools/front_end/sdk/DOMModel.js
+++ b/Source/devtools/front_end/sdk/DOMModel.js
@@ -456,10 +456,17 @@ WebInspector.DOMNode.prototype = {
this._agent.removeNode(this.id, this._domModel._markRevision(this, callback));
},
- copyNode: function()
+ /**
+ * @param {function(?string)=} callback
+ */
+ copyNode: function(callback)
{
function copy(error, text)
{
+ if (callback) {
aandrey 2014/07/18 05:30:05 call the callback after the copyText?
apavlov 2014/07/18 09:02:08 The idea here was that if we have a callback, the
+ callback(error ? null : text);
+ return;
+ }
if (!error)
InspectorFrontendHost.copyText(text);
}
@@ -707,6 +714,17 @@ WebInspector.DOMNode.prototype = {
/**
* @param {!WebInspector.DOMNode} targetNode
* @param {?WebInspector.DOMNode} anchorNode
+ * @param {boolean} deep
+ * @param {function(?Protocol.Error, !DOMAgent.NodeId=)=} callback
+ */
+ copyTo: function(targetNode, anchorNode, deep, callback)
+ {
+ this._agent.copyTo(this.id, targetNode.id, anchorNode ? anchorNode.id : undefined, deep, this._domModel._markRevision(this, callback));
+ },
+
+ /**
+ * @param {!WebInspector.DOMNode} targetNode
+ * @param {?WebInspector.DOMNode} anchorNode
* @param {function(?Protocol.Error, !DOMAgent.NodeId=)=} callback
*/
moveTo: function(targetNode, anchorNode, callback)

Powered by Google App Engine
This is Rietveld 408576698