Merge pull request #1613 from ckaczor/issue-1494

Issue #1494 - Fix middle click for closing tabs
This commit is contained in:
Eugene 2019-10-13 20:19:09 -07:00 committed by GitHub
commit 5c2e8a1db1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,10 +78,19 @@ export class TabHeaderComponent {
this.showRenameTabModal() this.showRenameTabModal()
} }
@HostListener('auxclick', ['$event']) async onAuxClick ($event: MouseEvent) { @HostListener('mousedown', ['$event']) async onMouseDown ($event: MouseEvent) {
if ($event.which === 2) {
$event.preventDefault()
}
}
@HostListener('mouseup', ['$event']) async onMouseUp ($event: MouseEvent) {
if ($event.which === 2) { if ($event.which === 2) {
this.app.closeTab(this.tab, true) this.app.closeTab(this.tab, true)
} }
}
@HostListener('auxclick', ['$event']) async onAuxClick ($event: MouseEvent) {
if ($event.which === 3) { if ($event.which === 3) {
$event.preventDefault() $event.preventDefault()