From e2c86c4b9603fbbce936685eff6c62d0cd31a366 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 17 Jun 2020 10:52:41 +0100 Subject: [PATCH] Fix wiring nodes from input back to output --- .../@node-red/editor-client/src/js/ui/view.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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 b9ae50071..7d28a2e65 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 @@ -2280,7 +2280,7 @@ RED.view = (function() { } function portMouseDown(d,portType,portIndex, evt) { - if (RED.view.DEBUG) { console.warn("portMouseDown", mouse_mode,d); } + if (RED.view.DEBUG) { console.warn("portMouseDown", mouse_mode,d,portType,portIndex); } evt = evt || d3.event; if (evt === 1) { return; @@ -2306,7 +2306,7 @@ RED.view = (function() { } function portMouseUp(d,portType,portIndex,evt) { - if (RED.view.DEBUG) { console.warn("portMouseUp", mouse_mode,d); } + if (RED.view.DEBUG) { console.warn("portMouseUp", mouse_mode,d,portType,portIndex); } evt = evt || d3.event; if (mouse_mode === RED.state.SELECTING_NODE) { evt.stopPropagation(); @@ -2712,6 +2712,12 @@ RED.view = (function() { } else if (d.type === 'link out') { direction = 0; } + } else { + if (drag_lines[0].portType === 1) { + direction = PORT_TYPE_OUTPUT; + } else { + direction = PORT_TYPE_INPUT; + } } } } @@ -3025,7 +3031,7 @@ RED.view = (function() { } } - function portMouseDownProxy(e) { portMouseDown(this.__data__,this.__portType__,this.__portIndex__, e); } + function portMouseDownProxy(e) { portMouseDown(this.__data__,this.__portType__,this.__portIndex__, e); } function portTouchStartProxy(e) { portMouseDown(this.__data__,this.__portType__,this.__portIndex__, e); e.preventDefault() } function portMouseUpProxy(e) { portMouseUp(this.__data__,this.__portType__,this.__portIndex__, e); } function portTouchEndProxy(e) { portMouseUp(this.__data__,this.__portType__,this.__portIndex__, e); e.preventDefault() } @@ -3852,7 +3858,7 @@ RED.view = (function() { portPort.addEventListener("mousedown", portMouseDownProxy); portPort.addEventListener("touchstart", portTouchStartProxy); portPort.addEventListener("mouseup", portMouseUpProxy); - portPort.addEventListener("touchstart", portTouchEndProxy); + portPort.addEventListener("touchend", portTouchEndProxy); portPort.addEventListener("mouseover", portMouseOverProxy); portPort.addEventListener("mouseout", portMouseOutProxy);