Skip to content

Commit

Permalink
fix: do not enter minimize mode when closing views quickly in maximiz…
Browse files Browse the repository at this point in the history
…e mode

Fixes #24
  • Loading branch information
mofogasy authored and danielwiehl committed Dec 11, 2018
1 parent 27f635c commit 375dace
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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());
}
});
});
}
Expand Down

0 comments on commit 375dace

Please sign in to comment.