mirror of
https://github.com/zadam/trilium.git
synced 2025-11-18 06:24:30 +01:00
fix(tab_manager): correct order when reopening tabs
This commit is contained in:
parent
be19d1f5b5
commit
4afea27fa5
@ -820,12 +820,15 @@ export default class TabRowWidget extends BasicWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
contextsReopenedEvent({ mainNtxId, tabPosition }: EventData<"contextsReopened">) {
|
contextsReopenedEvent({ mainNtxId, tabPosition }: EventData<"contextsReopened">) {
|
||||||
if (!mainNtxId || !tabPosition) {
|
if (!mainNtxId || tabPosition < 0) {
|
||||||
// no tab reopened
|
// no tab reopened
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const tabEl = this.getTabById(mainNtxId)[0];
|
const tabEl = this.getTabById(mainNtxId)[0];
|
||||||
tabEl.parentNode?.insertBefore(tabEl, this.tabEls[tabPosition]);
|
|
||||||
|
if ( tabEl && tabEl.parentNode ){
|
||||||
|
tabEl.parentNode.insertBefore(tabEl, this.tabEls[tabPosition]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateTabById(ntxId: string | null) {
|
updateTabById(ntxId: string | null) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user