mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-31 23:47:28 -08:00
add drop hover highlight
This commit is contained in:
parent
10b6291fa0
commit
c124fb62d2
|
@ -1328,6 +1328,7 @@ export default mixins(
|
||||||
|
|
||||||
this.instance.bind('connection', (info: OnConnectionBindInfo) => {
|
this.instance.bind('connection', (info: OnConnectionBindInfo) => {
|
||||||
info.connection.setConnector(['Flowchart', { cornerRadius: 8, stub: JSPLUMB_FLOWCHART_STUB, gap: 5, alwaysRespectStubs: false}]);
|
info.connection.setConnector(['Flowchart', { cornerRadius: 8, stub: JSPLUMB_FLOWCHART_STUB, gap: 5, alwaysRespectStubs: false}]);
|
||||||
|
info.connection.setPaintStyle({stroke: getStyleTokenValue('--color-foreground-dark'), strokeWidth: 2, outlineStroke: "transparent", outlineWidth: 12});
|
||||||
|
|
||||||
addEndpointArrow(info.connection);
|
addEndpointArrow(info.connection);
|
||||||
showOrHideMidpointArrow(info.connection);
|
showOrHideMidpointArrow(info.connection);
|
||||||
|
@ -1544,6 +1545,31 @@ export default mixins(
|
||||||
info.connection.removeOverlays();
|
info.connection.removeOverlays();
|
||||||
this.__removeConnectionByConnectionInfo(info, false);
|
this.__removeConnectionByConnectionInfo(info, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
this.instance.bind('connectionDrag', (connection: Connection) => {
|
||||||
|
const onMouseMove = () => {
|
||||||
|
if (!connection) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const elements = document.querySelector('div.jtk-endpoint.dropHover');
|
||||||
|
if (elements) {
|
||||||
|
connection.setPaintStyle({stroke: getStyleTokenValue('--color-primary')});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
connection.setPaintStyle({stroke: getStyleTokenValue('--color-foreground-dark')});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const onMouseUp = () => {
|
||||||
|
window.removeEventListener('mousemove', onMouseMove);
|
||||||
|
window.removeEventListener('mouseup', onMouseUp);
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener('mousemove', onMouseMove);
|
||||||
|
window.addEventListener('mouseup', onMouseUp);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
async newWorkflow (): Promise<void> {
|
async newWorkflow (): Promise<void> {
|
||||||
await this.resetWorkspace();
|
await this.resetWorkspace();
|
||||||
|
|
Loading…
Reference in a new issue