mirror of
https://github.com/zadam/trilium.git
synced 2025-11-05 04:45:47 +01:00
open the pane on the correct position
This commit is contained in:
@@ -329,8 +329,25 @@ export default class TabManager extends Component {
|
||||
tabReorderEvent({ntxIdsInOrder}) {
|
||||
const order = {};
|
||||
|
||||
for (const i in ntxIdsInOrder) {
|
||||
order[ntxIdsInOrder[i]] = i;
|
||||
let i = 0;
|
||||
|
||||
for (const ntxId in ntxIdsInOrder) {
|
||||
for (const noteContext of this.noteContexts[ntxId].getSubContexts()) {
|
||||
order[noteContext.ntxId] = i++;
|
||||
}
|
||||
}
|
||||
|
||||
this.children.sort((a, b) => order[a.ntxId] < order[b.ntxId] ? -1 : 1);
|
||||
|
||||
this.tabsUpdate.scheduleUpdate();
|
||||
}
|
||||
|
||||
noteContextReorderEvent({ntxIdsInOrder}) {
|
||||
const order = {};
|
||||
let i = 0;
|
||||
|
||||
for (const ntxId in ntxIdsInOrder) {
|
||||
order[ntxId] = i++;
|
||||
}
|
||||
|
||||
this.children.sort((a, b) => order[a.ntxId] < order[b.ntxId] ? -1 : 1);
|
||||
|
||||
Reference in New Issue
Block a user