make middle mouse button close tabs (fixes #92)

This commit is contained in:
Eugene Pankov 2017-07-10 17:35:01 +02:00
parent 42007f4fef
commit 29a6fb60de

View file

@ -1,4 +1,4 @@
import { Component, Input, Output, EventEmitter, HostBinding } from '@angular/core'
import { Component, Input, Output, EventEmitter, HostBinding, HostListener } from '@angular/core'
import { BaseTabComponent } from '../components/baseTab.component'
@Component({
@ -12,4 +12,10 @@ export class TabHeaderComponent {
@Input() @HostBinding('class.has-activity') hasActivity: boolean
@Input() tab: BaseTabComponent
@Output() closeClicked = new EventEmitter()
@HostListener('auxclick', ['$event']) onClick ($event: MouseEvent): void {
if ($event.which == 2) {
this.closeClicked.emit()
}
}
}