1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-11-11 01:28:58 +03:00

Improve wheel-scrolling in Firefox

This commit is contained in:
Jan Oberhauser 2020-10-23 18:43:30 +02:00
parent c7b1cbbc72
commit d90a5e5dc6
2 changed files with 8 additions and 6 deletions

View File

@ -24,10 +24,7 @@
"test:e2e": "vue-cli-service test:e2e",
"test:unit": "vue-cli-service test:unit"
},
"dependencies": {
"uuid": "^8.1.0",
"vue2-touch-events": "^2.3.2"
},
"dependencies": {},
"devDependencies": {
"@beyonk/google-fonts-webpack-plugin": "^1.2.3",
"@fortawesome/fontawesome-svg-core": "^1.2.19",
@ -70,6 +67,7 @@
"lodash.set": "^4.3.2",
"n8n-workflow": "~0.42.0",
"node-sass": "^4.12.0",
"normalize-wheel": "^1.0.1",
"prismjs": "^1.17.1",
"quill": "^2.0.0-dev.3",
"quill-autoformat": "^0.1.1",
@ -78,6 +76,7 @@
"ts-jest": "^26.3.0",
"tslint": "^6.1.2",
"typescript": "~3.9.7",
"uuid": "^8.1.0",
"vue": "^2.6.9",
"vue-cli-plugin-webpack-bundle-analyzer": "^2.0.0",
"vue-json-tree": "^0.4.1",
@ -85,6 +84,7 @@
"vue-router": "^3.0.6",
"vue-template-compiler": "^2.5.17",
"vue-typed-mixins": "^0.2.0",
"vue2-touch-events": "^2.3.2",
"vuex": "^3.1.1"
}
}

View File

@ -1,4 +1,5 @@
import mixins from 'vue-typed-mixins';
import normalizeWheel from 'normalize-wheel';
import { deviceSupportHelpers } from '@/components/mixins/deviceSupportHelpers';
import { nodeIndex } from '@/components/mixins/nodeIndex';
@ -96,9 +97,10 @@ export const moveNodeWorkflow = mixins(
this.moveWorkflow(e);
},
wheelMoveWorkflow (e: WheelEvent) {
const normalized = normalizeWheel(e);
const offsetPosition = this.$store.getters.getNodeViewOffsetPosition;
const nodeViewOffsetPositionX = offsetPosition[0] - e.deltaX;
const nodeViewOffsetPositionY = offsetPosition[1] - e.deltaY;
const nodeViewOffsetPositionX = offsetPosition[0] - normalized.pixelX;
const nodeViewOffsetPositionY = offsetPosition[1] - normalized.pixelY;
this.$store.commit('setNodeViewOffsetPosition', [nodeViewOffsetPositionX, nodeViewOffsetPositionY]);
},
},