From 1c337f6817b2e55093595bb0157da592046c3d17 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 8 Jul 2020 13:22:26 +0100 Subject: [PATCH] Fix connecting wires to subflow status or io ports on touchscreen --- .../@node-red/editor-client/src/js/ui/view.js | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js index 4d9b4ef61..b49e4a836 100755 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js @@ -2328,18 +2328,45 @@ RED.view = (function() { document.body.style.cursor = ""; if (mouse_mode == RED.state.JOINING || mouse_mode == RED.state.QUICK_JOINING) { if (typeof TouchEvent != "undefined" && evt instanceof TouchEvent) { + var found = false; RED.nodes.eachNode(function(n) { if (n.z == RED.workspaces.active()) { var hw = n.w/2; var hh = n.h/2; if (n.x-hw mouse_position[0] && n.y-hhmouse_position[1]) { + found = true; mouseup_node = n; portType = mouseup_node.inputs>0?PORT_TYPE_INPUT:PORT_TYPE_OUTPUT; portIndex = 0; } } }); + if (!found && activeSubflow) { + var subflowPorts = []; + if (activeSubflow.status) { + subflowPorts.push(activeSubflow.status) + } + if (activeSubflow.in) { + subflowPorts = subflowPorts.concat(activeSubflow.in) + } + if (activeSubflow.out) { + subflowPorts = subflowPorts.concat(activeSubflow.out) + } + for (var i=0;i mouse_position[0] && + n.y-hhmouse_position[1]) { + found = true; + mouseup_node = n; + portType = mouseup_node.direction === "in"?PORT_TYPE_OUTPUT:PORT_TYPE_INPUT; + portIndex = 0; + break; + } + } + } } else { mouseup_node = d; }