revert Listen on explorer view collapse / expand to expand the fixed open editors view

This commit is contained in:
isidor 2016-06-15 18:20:08 +02:00
parent 50b395d959
commit 431a72d7e0
3 changed files with 5 additions and 30 deletions

View file

@ -6,7 +6,7 @@
'use strict';
import 'vs/css!./media/explorerviewlet';
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
import {IDisposable} from 'vs/base/common/lifecycle';
import {IAction} from 'vs/base/common/actions';
import {TPromise} from 'vs/base/common/winjs.base';
import {Dimension, Builder} from 'vs/base/browser/builder';
@ -47,7 +47,6 @@ export class ExplorerViewlet extends Viewlet {
private viewletSettings: any;
private viewletState: FileViewletState;
private dimension: Dimension;
private toDispose: IDisposable[];
private viewletVisibleContextKey: IKeybindingContextKey<boolean>;
@ -68,7 +67,6 @@ export class ExplorerViewlet extends Viewlet {
this.viewletSettings = this.getMemento(storageService, Scope.WORKSPACE);
this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(e.config));
this.toDispose = [];
}
public create(parent: Builder): TPromise<void> {
@ -177,18 +175,6 @@ export class ExplorerViewlet extends Viewlet {
const headerSize = this.openEditorsVisible ? undefined : 0; // If open editors are not visible set header size explicitly to 0, otherwise let it be computed by super class.
this.explorerView = explorerView = explorerInstantiator.createInstance(ExplorerView, this.viewletState, this.getActionRunner(), this.viewletSettings, headerSize);
// Listen on explorer view collapse / expand to grow / shrink the fixed open editors view #6666
this.toDispose.push(this.explorerView.addListener2('collapse', () => {
if (this.openEditorsView) {
this.openEditorsView.updateBodySize(Number.MAX_VALUE);
}
}));
this.toDispose.push(this.explorerView.addListener2('expand', () => {
if (this.openEditorsView) {
this.openEditorsView.updateBodySize();
}
}));
}
// No workspace
@ -302,7 +288,6 @@ export class ExplorerViewlet extends Viewlet {
}
public dispose(): void {
this.toDispose = dispose(this.toDispose);
if (this.splitView) {
this.splitView.dispose();
this.splitView = null;

View file

@ -104,16 +104,6 @@ export class ExplorerView extends CollapsibleViewletView {
super.renderHeader(container);
}
public collapse(): void {
super.collapse();
this.emit('collapse');
}
public expand(): void {
super.expand();
this.emit('expand');
}
public renderBody(container: HTMLElement): void {
this.treeContainer = super.renderViewTree(container);
DOM.addClass(this.treeContainer, 'explorer-folders-view');

View file

@ -166,7 +166,7 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView {
private structuralTreeUpdate(): void {
// View size
this.updateBodySize();
this.expandedBodySize = this.getExpandedBodySize(this.model);
// Show groups only if there is more than 1 group
const treeInput = this.model.groups.length === 1 ? this.model.groups[0] : this.model;
// TODO@Isidor temporary workaround due to a partial tree refresh issue
@ -212,7 +212,7 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView {
}
// Adjust expanded body size
this.updateBodySize();
this.expandedBodySize = this.getExpandedBodySize(this.model);
}
private updateDirtyIndicator(): void {
@ -226,8 +226,8 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView {
}
}
public updateBodySize(newSize?: number): void {
this.expandedBodySize = newSize ? newSize : OpenEditorsView.computeExpandedBodySize(this.model, this.visibleOpenEditors, this.dynamicHeight);
private getExpandedBodySize(model: IEditorStacksModel): number {
return OpenEditorsView.computeExpandedBodySize(model, this.visibleOpenEditors, this.dynamicHeight);
}
private static computeExpandedBodySize(model: IEditorStacksModel, visibleOpenEditors = OpenEditorsView.DEFAULT_VISIBLE_OPEN_EDITORS, dynamicHeight = OpenEditorsView.DEFAULT_DYNAMIC_HEIGHT): number {