Fix previous tab not activated on close

This commit is contained in:
Thomas Brouard 2016-11-02 21:05:43 +01:00
parent b57253c82f
commit 7dd4b2aa98

View file

@ -223,10 +223,10 @@ class Tab extends EventEmitter {
let tabGroup = this.tabGroup; let tabGroup = this.tabGroup;
tabGroup.tabContainer.removeChild(this.tab); tabGroup.tabContainer.removeChild(this.tab);
tabGroup.viewContainer.removeChild(this.webview); tabGroup.viewContainer.removeChild(this.webview);
let activeTab = this.tabGroup.getActiveTab();
TabGroupPrivate.removeTab.bind(tabGroup)(this, true); TabGroupPrivate.removeTab.bind(tabGroup)(this, true);
this.emit("close", this); this.emit("close", this);
let activeTab = this.tabGroup.getActiveTab();
if (activeTab.id === this.id) { if (activeTab.id === this.id) {
TabGroupPrivate.activateRecentTab.bind(tabGroup)(); TabGroupPrivate.activateRecentTab.bind(tabGroup)();
} }