mirror of
https://github.com/zadam/trilium.git
synced 2025-12-03 22:14:24 +01:00
fix(mobile/split): swapping between splits
This commit is contained in:
parent
1d1639e5e1
commit
99da145d65
@ -79,22 +79,22 @@ export default class SplitNoteContainer extends FlexContainer<SplitNoteWidget> {
|
|||||||
noteContext = subContexts.find(s => s.ntxId !== ntxId)!;
|
noteContext = subContexts.find(s => s.ntxId !== ntxId)!;
|
||||||
} else {
|
} else {
|
||||||
noteContext = await appContext.tabManager.openEmptyTab(null, hoistedNoteId, mainNtxId);
|
noteContext = await appContext.tabManager.openEmptyTab(null, hoistedNoteId, mainNtxId);
|
||||||
}
|
// remove the original position of newly created note context
|
||||||
if (!noteContext.ntxId) {
|
const ntxIds = appContext.tabManager.children.map((c) => c.ntxId).filter((id) => id !== noteContext.ntxId) as string[];
|
||||||
logError("Failed to create new note context!");
|
|
||||||
return;
|
// insert the note context after the originating note context
|
||||||
|
if (!noteContext.ntxId) {
|
||||||
|
logError("Failed to create new note context!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ntxIds.splice(ntxIds.indexOf(ntxId) + 1, 0, noteContext.ntxId);
|
||||||
|
|
||||||
|
this.triggerCommand("noteContextReorder", { ntxIdsInOrder: ntxIds });
|
||||||
|
|
||||||
|
// move the note context rendered widget after the originating widget
|
||||||
|
this.$widget.find(`[data-ntx-id="${noteContext.ntxId}"]`).insertAfter(this.$widget.find(`[data-ntx-id="${ntxId}"]`));
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove the original position of newly created note context
|
|
||||||
const ntxIds = appContext.tabManager.children.map((c) => c.ntxId).filter((id) => id !== noteContext.ntxId) as string[];
|
|
||||||
|
|
||||||
// insert the note context after the originating note context
|
|
||||||
ntxIds.splice(ntxIds.indexOf(ntxId) + 1, 0, noteContext.ntxId);
|
|
||||||
|
|
||||||
this.triggerCommand("noteContextReorder", { ntxIdsInOrder: ntxIds });
|
|
||||||
|
|
||||||
// move the note context rendered widget after the originating widget
|
|
||||||
this.$widget.find(`[data-ntx-id="${noteContext.ntxId}"]`).insertAfter(this.$widget.find(`[data-ntx-id="${ntxId}"]`));
|
|
||||||
|
|
||||||
await appContext.tabManager.activateNoteContext(noteContext.ntxId);
|
await appContext.tabManager.activateNoteContext(noteContext.ntxId);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user