From 099bc8fdb8031ba71ad622f335a0bbb951870b06 Mon Sep 17 00:00:00 2001 From: mofogasy Date: Fri, 30 Nov 2018 08:51:55 +0100 Subject: [PATCH] Do not enter minimize mode when closing views quickly in maximize mode (#24) --- .../src/lib/view-part/view-tab/view-tab.component.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/projects/scion/workbench/src/lib/view-part/view-tab/view-tab.component.ts b/projects/scion/workbench/src/lib/view-part/view-tab/view-tab.component.ts index 972f1926a..4e7a1ac59 100644 --- a/projects/scion/workbench/src/lib/view-part/view-tab/view-tab.component.ts +++ b/projects/scion/workbench/src/lib/view-part/view-tab/view-tab.component.ts @@ -17,7 +17,7 @@ import { InternalWorkbenchService } from '../../workbench.service'; import { VIEW_DRAG_TYPE } from '../../workbench.constants'; import { WorkbenchLayoutService } from '../../workbench-layout.service'; import { WorkbenchViewRegistry } from '../../workbench-view-registry.service'; -import { filter, takeUntil } from 'rxjs/operators'; +import { takeUntil } from 'rxjs/operators'; @Component({ selector: 'wb-view-tab', @@ -178,12 +178,13 @@ export class ViewTabComponent implements OnDestroy { fromEvent(this._host, 'dblclick') .pipe( - filter(() => enabled), takeUntil(this._destroy$) ) .subscribe((event: Event) => { - zone.run(() => this._workbenchLayout.toggleMaximized()); event.stopPropagation(); // prevent `ViewPartBarComponent` handling the dblclick event which would undo maximization/minimization + if (enabled) { + zone.run(() => this._workbenchLayout.toggleMaximized()); + } }); }); }