mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
progress
This commit is contained in:
@@ -127,6 +127,8 @@ class AppContext {
|
||||
activateNote(notePath) {
|
||||
const activeTabContext = this.getActiveTabContext();
|
||||
|
||||
console.log("Setting activeTabContext to " + notePath);
|
||||
|
||||
activeTabContext.setNote(notePath);
|
||||
|
||||
this._setTitleBar();
|
||||
@@ -209,36 +211,6 @@ class AppContext {
|
||||
}
|
||||
}
|
||||
|
||||
async showTab(tabId) {
|
||||
for (const ctx of this.tabContexts) {
|
||||
if (ctx.tabId === tabId) {
|
||||
await ctx.show();
|
||||
} else {
|
||||
ctx.hide();
|
||||
}
|
||||
}
|
||||
|
||||
const oldActiveNode = this.getMainNoteTree().getActiveNode();
|
||||
|
||||
if (oldActiveNode) {
|
||||
oldActiveNode.setActive(false);
|
||||
}
|
||||
|
||||
const newActiveTabContext = this.getActiveTabContext();
|
||||
|
||||
if (newActiveTabContext && newActiveTabContext.notePath) {
|
||||
const newActiveNode = await this.getMainNoteTree().getNodeFromPath(newActiveTabContext.notePath);
|
||||
|
||||
if (newActiveNode) {
|
||||
if (!newActiveNode.isVisible()) {
|
||||
await this.getMainNoteTree().expandToNote(newActiveTabContext.notePath);
|
||||
}
|
||||
|
||||
newActiveNode.setActive(true, {noEvents: true});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {NoteTreeWidget}
|
||||
*/
|
||||
@@ -343,10 +315,6 @@ class AppContext {
|
||||
this.openEmptyTab();
|
||||
}
|
||||
|
||||
async activeTabChangedListener({tabId}) {
|
||||
await this.showTab(tabId);
|
||||
}
|
||||
|
||||
async tabRemoveListener({tabId}) {
|
||||
this.tabContexts.filter(nc => nc.tabId === tabId)
|
||||
.forEach(tc => tc.remove());
|
||||
|
||||
Reference in New Issue
Block a user