mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-30 05:42:00 -08:00
refactor
This commit is contained in:
parent
828291df2c
commit
78b581880f
|
@ -1503,17 +1503,11 @@ export default mixins(
|
||||||
const elements = document.querySelector('div.jtk-endpoint.dropHover');
|
const elements = document.querySelector('div.jtk-endpoint.dropHover');
|
||||||
if (elements && !droppable) {
|
if (elements && !droppable) {
|
||||||
droppable = true;
|
droppable = true;
|
||||||
connection.setConnector(CanvasHelpers.getFlowChartType(connection));
|
CanvasHelpers.showDropConnectionState(connection);
|
||||||
connection.setPaintStyle(CanvasHelpers.CONNECTOR_PAINT_STYLE_PRIMARY);
|
|
||||||
CanvasHelpers.addOverlays(connection, CanvasHelpers.CONNECTOR_ARROW_OVERLAYS);
|
|
||||||
CanvasHelpers.hideOverlay(connection, CanvasHelpers.OVERLAY_DROP_NODE_ID);
|
|
||||||
}
|
}
|
||||||
else if (!elements && droppable) {
|
else if (!elements && droppable) {
|
||||||
droppable = false;
|
droppable = false;
|
||||||
connection.setConnector(CanvasHelpers.CONNECTOR_TYPE_STRIGHT);
|
CanvasHelpers.showPullConnectionState(connection);
|
||||||
connection.setPaintStyle(CanvasHelpers.CONNECTOR_PAINT_STYLE_DEFAULT);
|
|
||||||
CanvasHelpers.addOverlays(connection, CanvasHelpers.CONNECTOR_ARROW_OVERLAYS);
|
|
||||||
CanvasHelpers.showOverlay(connection, CanvasHelpers.OVERLAY_DROP_NODE_ID);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -520,3 +520,17 @@ export const getUniqueNodeName = (nodes: INodeUi[], originalName: string, additi
|
||||||
|
|
||||||
return uniqueName;
|
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);
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in a new issue