From 36c9f7ab5b6fd9129364a157d1497132a9e8b122 Mon Sep 17 00:00:00 2001 From: Mutasem Date: Fri, 29 Oct 2021 13:09:13 +0200 Subject: [PATCH] fix z-index bug --- packages/editor-ui/src/views/NodeView.vue | 24 ++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/packages/editor-ui/src/views/NodeView.vue b/packages/editor-ui/src/views/NodeView.vue index 00ba687017..958a51d763 100644 --- a/packages/editor-ui/src/views/NodeView.vue +++ b/packages/editor-ui/src/views/NodeView.vue @@ -1962,6 +1962,17 @@ export default mixins( const sourceIndex = this.$store.getters.getNodeIndex(sourceNodeName); const sourceId = `${NODE_NAME_PREFIX}${sourceIndex}`; + const resetConnection = (connection: Connection) => { + connection.removeOverlay(OVERLAY_RUN_ITEMS_ID); + connection.setPaintStyle(CONNECTOR_PAINT_STYLE_DEFAULT); + showOrHideMidpointArrow(connection); + // @ts-ignore + if (connection.canvas) { + // @ts-ignore + (connection.canvas as Element).classList.remove('success'); + } + }; + if (data === null || data.length === 0) { // @ts-ignore const outgoing = this.instance.getConnections({ @@ -1969,8 +1980,7 @@ export default mixins( }) as Connection[]; outgoing.forEach((connection: Connection) => { - connection.removeOverlay(OVERLAY_RUN_ITEMS_ID); - connection.setPaintStyle(CONNECTOR_PAINT_STYLE_DEFAULT); + resetConnection(connection); }); return; @@ -2031,15 +2041,7 @@ export default mixins( const output = outputMap[sourceOutputIndex][targetNodeName][targetInputIndex]; if (!output || !output.total) { - conn.setPaintStyle(CONNECTOR_PAINT_STYLE_DEFAULT); - conn.removeOverlay(OVERLAY_RUN_ITEMS_ID); - showOrHideMidpointArrow(conn); - - // @ts-ignore - if (conn.canvas) { - // @ts-ignore - (conn.canvas as Element).classList.remove('success'); - } + resetConnection(conn); return; }