"move to new window" respects note hoisting of original tab

This commit is contained in:
zadam
2021-02-07 21:27:09 +01:00
parent cd5be59413
commit bed7bdfd00
9 changed files with 38 additions and 14 deletions

View File

@@ -58,7 +58,8 @@ export default class TabManager extends Component {
else {
tabsToOpen.push({
notePath: notePath,
active: true
active: true,
hoistedNoteId: glob.extraHoistedNoteId || 'root'
});
}
}
@@ -83,7 +84,8 @@ export default class TabManager extends Component {
if (filteredTabs.length === 0) {
filteredTabs.push({
notePath: this.isMainWindow ? 'root' : '',
active: true
active: true,
extraHoistedNoteId: glob.extraHoistedNoteId || 'root'
});
}
@@ -91,6 +93,8 @@ export default class TabManager extends Component {
filteredTabs[0].active = true;
}
console.log("filteredTabs", filteredTabs);
await this.tabsUpdate.allowUpdateWithoutChange(async () => {
for (const tab of filteredTabs) {
await this.openTabWithNote(tab.notePath, tab.active, tab.tabId, tab.hoistedNoteId);
@@ -348,11 +352,11 @@ export default class TabManager extends Component {
}
moveTabToNewWindowCommand({tabId}) {
const notePath = this.getTabContextById(tabId).notePath;
const {notePath, hoistedNoteId} = this.getTabContextById(tabId);
this.removeTab(tabId);
this.triggerCommand('openInWindow', {notePath});
this.triggerCommand('openInWindow', {notePath, hoistedNoteId});
}
hoistedNoteChangedEvent() {