clear title control when closing

This commit is contained in:
Benjamin Pasero 2016-06-15 12:54:08 +02:00
parent 86175ecaee
commit 2cc248adcc
2 changed files with 14 additions and 13 deletions

View file

@ -133,13 +133,12 @@ export class NoTabsTitleControl extends TitleControl {
}
protected doRefresh(): void {
if (!this.context) {
return;
}
const group = this.context;
const editor = group.activeEditor;
const editor = group && group.activeEditor;
if (!editor) {
this.titleLabel.innerText = '';
this.titleDescription.innerText = '';
this.editorActionsToolbar.setActions([], [])();
this.currentPrimaryEditorActionIds = [];

View file

@ -214,13 +214,11 @@ export class TabsTitleControl extends TitleControl {
}
protected doRefresh(): void {
if (!this.context) {
return;
}
const group = this.context;
const editor = group.activeEditor;
const editor = group && group.activeEditor;
if (!editor) {
this.clearTabs();
this.groupActionsToolbar.setActions([], [])();
this.currentPrimaryGroupActionIds = [];
@ -249,12 +247,16 @@ export class TabsTitleControl extends TitleControl {
this.doUpdate();
}
private refreshTabs(group: IEditorGroup): void {
// Empty container first
private clearTabs(): void {
DOM.clearNode(this.tabsContainer);
dispose(this.tabDisposeables);
this.tabDisposeables = [];
}
private refreshTabs(group: IEditorGroup): void {
// Empty container first
this.clearTabs();
const tabContainers: HTMLElement[] = [];