forked from github/dataease
Merge pull request #6413 from dataease/pr@dev-v2@fix_wheelscroll
refactor: 鼠标滚轮放大效果优化
This commit is contained in:
commit
fd88f001e9
@ -48,15 +48,15 @@ const handleMouseWheel = e => {
|
|||||||
let areaRight = dvMain.clientWidth + areaLeftWidth
|
let areaRight = dvMain.clientWidth + areaLeftWidth
|
||||||
if (areaLeftWidth < e.clientX && e.clientX < areaRight) {
|
if (areaLeftWidth < e.clientX && e.clientX < areaRight) {
|
||||||
const delta = e.wheelDelta ? e.wheelDelta : -e.detail
|
const delta = e.wheelDelta ? e.wheelDelta : -e.detail
|
||||||
if (lastWheelNum === 240 && delta === 240) {
|
if ((lastWheelNum === 240 && delta === 240) || delta > 240) {
|
||||||
//放大
|
//放大
|
||||||
scaleIncrease(3)
|
scaleIncrease(3)
|
||||||
} else if (lastWheelNum === -240 && delta === -240) {
|
} else if ((lastWheelNum === -240 && delta === -240) || delta < -240) {
|
||||||
// 缩小
|
// 缩小
|
||||||
scaleDecrease(3)
|
scaleDecrease(3)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (delta === 240 || delta === -240) {
|
if (delta >= 240 || delta <= -240) {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user