hoisting improvements

This commit is contained in:
zadam
2020-11-24 23:24:05 +01:00
parent 9889166afc
commit 61f30373d4
9 changed files with 47 additions and 8 deletions

View File

@@ -193,6 +193,24 @@ export default class TabManager extends Component {
return tabContext;
}
/**
* If the requested notePath is within current note hoisting scope then keep the note hoisting also for the new tab.
*/
async openTabWithNoteWithHoisting(notePath) {
const tabContext = this.getActiveTabContext();
let hoistedNoteId = 'root';
if (tabContext) {
const resolvedNotePath = await treeService.resolveNotePath(notePath);
if (resolvedNotePath.includes(tabContext.hoistedNoteId)) {
hoistedNoteId = tabContext.hoistedNoteId;
}
}
return this.openTabWithNote(notePath, false, null, hoistedNoteId);
}
async openTabWithNote(notePath, activate, tabId, hoistedNoteId) {
const tabContext = await this.openEmptyTab(tabId, hoistedNoteId);