Reopen recently closed tab/split in place

This commit is contained in:
dymani
2023-06-03 05:54:33 +08:00
parent af67cf64b1
commit 2c8eb82d42
3 changed files with 50 additions and 5 deletions

View File

@@ -620,6 +620,15 @@ export default class TabRowWidget extends BasicWidget {
this.updateTabById(newMainNtxId);
}
contextsReopenedEvent({mainNtxId, tabPosition}) {
if (mainNtxId === undefined || tabPosition === undefined) {
// no tab reopened
return;
}
const tabEl = this.getTabById(mainNtxId)[0];
tabEl.parentNode.insertBefore(tabEl, this.tabEls[tabPosition]);
}
updateTabById(ntxId) {
const $tab = this.getTabById(ntxId);