Skip to content

Commit

Permalink
fixes #83726
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomoreno committed Nov 13, 2019
1 parent b5ce601 commit 5e7b782
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/vs/base/browser/ui/splitview/splitview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ abstract class ViewItem {
get priority(): LayoutPriority | undefined { return this.view.priority; }
get snap(): boolean { return !!this.view.snap; }

set enabled(enabled: boolean) {
this.container.style.pointerEvents = enabled ? null : 'none';
}

constructor(
protected container: HTMLElement,
private view: IView,
Expand Down Expand Up @@ -430,6 +434,10 @@ export class SplitView extends Disposable {
}

private onSashStart({ sash, start, alt }: ISashEvent): void {
for (const item of this.viewItems) {
item.enabled = false;
}

const index = firstIndex(this.sashItems, item => item.sash === sash);

// This way, we can press Alt while we resize a sash, macOS style!
Expand Down Expand Up @@ -535,6 +543,10 @@ export class SplitView extends Disposable {
this._onDidSashChange.fire(index);
this.sashDragState!.disposable.dispose();
this.saveProportions();

for (const item of this.viewItems) {
item.enabled = true;
}
}

private onViewChange(item: ViewItem, size: number | undefined): void {
Expand Down

0 comments on commit 5e7b782

Please sign in to comment.