mirror of
https://github.com/zadam/trilium.git
synced 2025-11-04 20:36:13 +01:00
"move to new window" respects note hoisting of original tab
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user