mirror of
https://github.com/zadam/trilium.git
synced 2025-11-05 04:45:47 +01:00
WIP per-tab hoisting
This commit is contained in:
@@ -11,10 +11,11 @@ class TabContext extends Component {
|
||||
/**
|
||||
* @param {string|null} tabId
|
||||
*/
|
||||
constructor(tabId = null) {
|
||||
constructor(tabId = null, hoistedNoteId = 'root') {
|
||||
super();
|
||||
|
||||
this.tabId = tabId || utils.randomString(4);
|
||||
this.hoistedNoteId = hoistedNoteId;
|
||||
}
|
||||
|
||||
setEmpty() {
|
||||
@@ -123,10 +124,24 @@ class TabContext extends Component {
|
||||
return {
|
||||
tabId: this.tabId,
|
||||
notePath: this.notePath,
|
||||
hoistedNoteId: this.hoistedNoteId,
|
||||
active: this.isActive()
|
||||
}
|
||||
}
|
||||
|
||||
async unhoist() {
|
||||
await this.setHoistedNoteId('root');
|
||||
}
|
||||
|
||||
async setHoistedNoteId(noteIdToHoist) {
|
||||
this.hoistedNoteId = noteIdToHoist;
|
||||
|
||||
await this.triggerEvent('hoistedNoteChanged', {
|
||||
noteId: noteIdToHoist,
|
||||
tabId: this.tabId
|
||||
});
|
||||
}
|
||||
|
||||
async entitiesReloadedEvent({loadResults}) {
|
||||
if (loadResults.isNoteReloaded(this.noteId)) {
|
||||
const note = await treeCache.getNote(this.noteId);
|
||||
|
||||
Reference in New Issue
Block a user