mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +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);
|
||||
},
|
||||
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"
|
||||
@mousedown="mouseDown"
|
||||
@mouseup="mouseUp"
|
||||
@wheel="wheelScroll"
|
||||
>
|
||||
<div class="node-view-background" :style="backgroundStyle"></div>
|
||||
<div id="node-view" class="node-view" :style="workflowStyle">
|
||||
@@ -339,6 +340,9 @@ export default mixins(
|
||||
this.mouseUpMouseSelect(e);
|
||||
this.mouseUpMoveWorkflow(e);
|
||||
},
|
||||
wheelScroll (e: WheelEvent) {
|
||||
this.wheelMoveWorkflow(e);
|
||||
},
|
||||
keyUp (e: KeyboardEvent) {
|
||||
if (e.key === this.controlKeyCode) {
|
||||
this.ctrlKeyPressed = false;
|
||||
|
||||
Reference in New Issue
Block a user