mirror of
https://github.com/zadam/trilium.git
synced 2025-11-18 06:24:30 +01:00
fix(tab_manager): correct order when reopening split pane
Some checks are pending
Checks / main (push) Waiting to run
Some checks are pending
Checks / main (push) Waiting to run
This commit is contained in:
parent
f57e90b35c
commit
0227449c55
@ -186,7 +186,9 @@ export default class SplitNoteContainer extends FlexContainer<SplitNoteWidget> {
|
|||||||
this.$widget.find(`[data-ntx-id="${ntxId}"]`).insertAfter(this.$widget.find(`[data-ntx-id="${afterNtxId}"]`));
|
this.$widget.find(`[data-ntx-id="${ntxId}"]`).insertAfter(this.$widget.find(`[data-ntx-id="${afterNtxId}"]`));
|
||||||
} else if (mainNtxId && tabPosition >= 0) {
|
} else if (mainNtxId && tabPosition >= 0) {
|
||||||
const contexts = appContext.tabManager.noteContexts;
|
const contexts = appContext.tabManager.noteContexts;
|
||||||
const beforeNtxId = contexts.find(c => c.mainNtxId === mainNtxId)?.ntxId || null;
|
const nextIndex = contexts.findIndex(c => c.ntxId === mainNtxId);
|
||||||
|
const beforeNtxId = (nextIndex !== -1 && nextIndex + 1 < contexts.length) ? contexts[nextIndex + 1].ntxId : null;
|
||||||
|
|
||||||
this.$widget.find(`[data-ntx-id="${mainNtxId}"]`).insertBefore(this.$widget.find(`[data-ntx-id="${beforeNtxId}"]`));
|
this.$widget.find(`[data-ntx-id="${mainNtxId}"]`).insertBefore(this.$widget.find(`[data-ntx-id="${beforeNtxId}"]`));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user