Skip to content

Commit

Permalink
Prevent dblclick event being handled by view tab when only clicked on…
Browse files Browse the repository at this point in the history
  • Loading branch information
mofogasy committed Sep 26, 2018
1 parent 3ccbccd commit c82f6bb
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,14 @@ export class ViewTabComponent {
@HostListener('click')
public onClick(): void {
this._viewPartService.activateView(this.viewRef).then(noop);
setTimeout(() => this._host.addEventListener('dblclick', this.onDoubleClick), 10);
setTimeout(() => this._host.removeEventListener('dblclick', this.onDoubleClick), 500);
}

@HostListener('dblclick', ['$event'])
public onDoubleClick(event: MouseEvent): void {
private onDoubleClick: (event: MouseEvent) => void = (event: MouseEvent): void => {
this._workbenchLayout.toggleMaximized();
event.stopPropagation();
}
};

@HostBinding('attr.draggable')
public get draggable(): boolean {
Expand Down

0 comments on commit c82f6bb

Please sign in to comment.