From 6f6f67829be75fa41a081dc80093d69af7f587ed Mon Sep 17 00:00:00 2001 From: Hiroyasu Nishiyama Date: Mon, 13 Jun 2022 14:12:04 +0900 Subject: [PATCH] fix undoing junction to subflow --- .../@node-red/editor-client/src/js/history.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/history.js b/packages/node_modules/@node-red/editor-client/src/js/history.js index f900276a0..b23071239 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/history.js +++ b/packages/node_modules/@node-red/editor-client/src/js/history.js @@ -22,6 +22,14 @@ RED.history = (function() { var undoHistory = []; var redoHistory = []; + function nodeOrJunction(id) { + var node = RED.nodes.node(id); + if (node) { + return node; + } + return RED.nodes.junction(id); + } + function undoEvent(ev) { var i; var len; @@ -514,6 +522,7 @@ RED.history = (function() { var z = ev.activeWorkspace; var fullNodeList = RED.nodes.filterNodes({z:ev.subflow.subflow.id}); fullNodeList = fullNodeList.concat(RED.nodes.groups(ev.subflow.subflow.id)) + fullNodeList = fullNodeList.concat(RED.nodes.junctions(ev.subflow.subflow.id)) fullNodeList.forEach(function(n) { n.x += ev.subflow.offsetX; n.y += ev.subflow.offsetY; @@ -523,7 +532,7 @@ RED.history = (function() { }); inverseEv.subflows = []; for (i=0;i