mirror of
https://github.com/Eugeny/tabby.git
synced 2024-12-25 19:42:42 +03:00
Merge pull request #537 from Drachenkaetzchen/bugfix-wheelevent-ts32
Fix for MouseWheelEvent deprecation in TypeScript 3.2
This commit is contained in:
commit
bd5f274cf3
@ -261,15 +261,23 @@ export class TerminalTabComponent extends BaseTabComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (event.type === 'mousewheel') {
|
if (event.type === 'mousewheel') {
|
||||||
|
let wheelDeltaY = 0
|
||||||
|
|
||||||
|
if ('wheelDeltaY' in event) {
|
||||||
|
wheelDeltaY = (event as MouseWheelEvent)["wheelDeltaY"]
|
||||||
|
} else {
|
||||||
|
wheelDeltaY = (event as MouseWheelEvent)["deltaY"]
|
||||||
|
}
|
||||||
if (event.ctrlKey || event.metaKey) {
|
if (event.ctrlKey || event.metaKey) {
|
||||||
if ((event as MouseWheelEvent).wheelDeltaY > 0) {
|
|
||||||
|
if (wheelDeltaY > 0) {
|
||||||
this.zoomIn()
|
this.zoomIn()
|
||||||
} else {
|
} else {
|
||||||
this.zoomOut()
|
this.zoomOut()
|
||||||
}
|
}
|
||||||
} else if (event.altKey) {
|
} else if (event.altKey) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
let delta = Math.round((event as MouseWheelEvent).wheelDeltaY / 50)
|
let delta = Math.round(wheelDeltaY / 50)
|
||||||
this.sendInput(((delta > 0) ? '\u001bOA' : '\u001bOB').repeat(Math.abs(delta)))
|
this.sendInput(((delta > 0) ? '\u001bOA' : '\u001bOB').repeat(Math.abs(delta)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user