From 789d64f7ed2f459c0368e279ade746b1a1b295aa Mon Sep 17 00:00:00 2001 From: Dave C-J Date: Thu, 3 Apr 2014 00:05:16 +0100 Subject: [PATCH] Add Ctrl-x (cut) to shortcuts --- public/index.html | 7 ++----- public/red/ui/view.js | 25 +++++++++++++------------ 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/public/index.html b/public/index.html index a0fb373ce..9c9ff0aaf 100644 --- a/public/index.html +++ b/public/index.html @@ -110,7 +110,6 @@
-
advanced
@@ -138,7 +137,6 @@
-
@@ -156,7 +154,6 @@
-
Drop the flow here
@@ -199,7 +196,8 @@ DeleteDelete selected nodes or link - + Ctrl xCut selected nodes + Ctrl cCopy selected nodes @@ -223,7 +221,6 @@
-
diff --git a/public/red/ui/view.js b/public/red/ui/view.js index d6a0d2c77..56eefc9a2 100644 --- a/public/red/ui/view.js +++ b/public/red/ui/view.js @@ -96,8 +96,8 @@ RED.view = function() { // "stroke" : "#eee", // "stroke-width" : "1px" // }); - - + + var drag_line = vis.append("svg:path").attr("class", "drag_line"); var workspace_tabs = RED.tabs.create({ @@ -117,7 +117,7 @@ RED.view = function() { } var scrollStartLeft = chart.scrollLeft(); var scrollStartTop = chart.scrollTop(); - + activeWorkspace = tab.id; if (workspaceScrollPositions[activeWorkspace]) { chart.scrollLeft(workspaceScrollPositions[activeWorkspace].left); @@ -132,7 +132,7 @@ RED.view = function() { mouse_position[0] += scrollDeltaLeft; mouse_position[1] += scrollDeltaTop; } - + clearSelection(); RED.nodes.eachNode(function(n) { n.dirty = true; @@ -336,7 +336,7 @@ RED.view = function() { minX = Math.min(node.n.x-node.n.w/2-5,minX); minY = Math.min(node.n.y-node.n.h/2-5,minY); } - if (minX != 0 || minY != 0) { + if (minX != 0 || minY != 0) { for (var n = 0; n 0) { @@ -904,7 +905,7 @@ RED.view = function() { (d._def.label?' '+(typeof d._def.labelStyle == "function" ? d._def.labelStyle.call(d):d._def.labelStyle):'') ; }); thisNode.selectAll(".node_tools").attr("x",function(d){return d.w-35;}).attr("y",function(d){return d.h-20;}); - + thisNode.selectAll(".node_changed") .attr("x",function(d){return d.w-10}) .classed("hidden",function(d) { return !d.changed; }); @@ -912,7 +913,7 @@ RED.view = function() { thisNode.selectAll(".node_error") .attr("x",function(d){return d.w-10-(d.changed?13:0)}) .classed("hidden",function(d) { return d.valid; }); - + thisNode.selectAll(".port_input").each(function(d,i) { var port = d3.select(this); port.attr("y",function(d){return (d.h/2)-5;}) @@ -1012,7 +1013,7 @@ RED.view = function() { link.classed("link_selected", function(d) { return d === selected_link || d.selected; }); link.classed("link_unknown",function(d) { return d.target.type == "unknown" || d.source.type == "unknown"}); - + if (d3.event) { d3.event.preventDefault(); } @@ -1060,7 +1061,7 @@ RED.view = function() { if (mouse_position == null) { mouse_position = [0,0]; } - + var minX = 0; var minY = 0;