This commit is contained in:
Mutasem 2021-11-01 17:27:59 +01:00
parent 828291df2c
commit 78b581880f
2 changed files with 16 additions and 8 deletions

View file

@ -1503,17 +1503,11 @@ export default mixins(
const elements = document.querySelector('div.jtk-endpoint.dropHover');
if (elements && !droppable) {
droppable = true;
connection.setConnector(CanvasHelpers.getFlowChartType(connection));
connection.setPaintStyle(CanvasHelpers.CONNECTOR_PAINT_STYLE_PRIMARY);
CanvasHelpers.addOverlays(connection, CanvasHelpers.CONNECTOR_ARROW_OVERLAYS);
CanvasHelpers.hideOverlay(connection, CanvasHelpers.OVERLAY_DROP_NODE_ID);
CanvasHelpers.showDropConnectionState(connection);
}
else if (!elements && droppable) {
droppable = false;
connection.setConnector(CanvasHelpers.CONNECTOR_TYPE_STRIGHT);
connection.setPaintStyle(CanvasHelpers.CONNECTOR_PAINT_STYLE_DEFAULT);
CanvasHelpers.addOverlays(connection, CanvasHelpers.CONNECTOR_ARROW_OVERLAYS);
CanvasHelpers.showOverlay(connection, CanvasHelpers.OVERLAY_DROP_NODE_ID);
CanvasHelpers.showPullConnectionState(connection);
}
};

View file

@ -520,3 +520,17 @@ export const getUniqueNodeName = (nodes: INodeUi[], originalName: string, additi
return uniqueName;
};
export const showDropConnectionState = (connection: Connection) => {
connection.setConnector(getFlowChartType(connection));
connection.setPaintStyle(CONNECTOR_PAINT_STYLE_PRIMARY);
addOverlays(connection, CONNECTOR_ARROW_OVERLAYS);
hideOverlay(connection, OVERLAY_DROP_NODE_ID);
};
export const showPullConnectionState = (connection: Connection) => {
connection.setConnector(CONNECTOR_TYPE_STRIGHT);
connection.setPaintStyle(CONNECTOR_PAINT_STYLE_DEFAULT);
addOverlays(connection, CONNECTOR_ARROW_OVERLAYS);
showOverlay(connection, OVERLAY_DROP_NODE_ID);
};