Fix middle click for closing tabs

This commit is contained in:
Chris Kaczor 2019-10-13 21:18:08 -04:00
parent 4bf67b0904
commit 3aa4c6105b

View file

@ -78,10 +78,19 @@ export class TabHeaderComponent {
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) {
this.app.closeTab(this.tab, true)
}
}
@HostListener('auxclick', ['$event']) async onAuxClick ($event: MouseEvent) {
if ($event.which === 3) {
$event.preventDefault()