mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
✨ Make it possible to move workflow with mouse-wheel/two-finger
This commit is contained in:
@@ -83,5 +83,11 @@ export const moveNodeWorkflow = mixins(nodeIndex).extend({
|
|||||||
|
|
||||||
this.moveWorkflow(e);
|
this.moveWorkflow(e);
|
||||||
},
|
},
|
||||||
|
wheelMoveWorkflow (e: WheelEvent) {
|
||||||
|
const offsetPosition = this.$store.getters.getNodeViewOffsetPosition;
|
||||||
|
const nodeViewOffsetPositionX = offsetPosition[0] - e.deltaX;
|
||||||
|
const nodeViewOffsetPositionY = offsetPosition[1] - e.deltaY;
|
||||||
|
this.$store.commit('setNodeViewOffsetPosition', [nodeViewOffsetPositionX, nodeViewOffsetPositionY]);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
:class="workflowClasses"
|
:class="workflowClasses"
|
||||||
@mousedown="mouseDown"
|
@mousedown="mouseDown"
|
||||||
@mouseup="mouseUp"
|
@mouseup="mouseUp"
|
||||||
|
@wheel="wheelScroll"
|
||||||
>
|
>
|
||||||
<div class="node-view-background" :style="backgroundStyle"></div>
|
<div class="node-view-background" :style="backgroundStyle"></div>
|
||||||
<div id="node-view" class="node-view" :style="workflowStyle">
|
<div id="node-view" class="node-view" :style="workflowStyle">
|
||||||
@@ -339,6 +340,9 @@ export default mixins(
|
|||||||
this.mouseUpMouseSelect(e);
|
this.mouseUpMouseSelect(e);
|
||||||
this.mouseUpMoveWorkflow(e);
|
this.mouseUpMoveWorkflow(e);
|
||||||
},
|
},
|
||||||
|
wheelScroll (e: WheelEvent) {
|
||||||
|
this.wheelMoveWorkflow(e);
|
||||||
|
},
|
||||||
keyUp (e: KeyboardEvent) {
|
keyUp (e: KeyboardEvent) {
|
||||||
if (e.key === this.controlKeyCode) {
|
if (e.key === this.controlKeyCode) {
|
||||||
this.ctrlKeyPressed = false;
|
this.ctrlKeyPressed = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user