提交 2cc248ad 编写于 作者: B Benjamin Pasero

clear title control when closing

上级 86175eca
......@@ -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 = [];
......
......@@ -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[] = [];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册