mirror of
https://github.com/zadam/trilium.git
synced 2025-10-29 01:06:36 +01:00
mobile frontend is working again
This commit is contained in:
@@ -66,7 +66,7 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
||||
this.$widget.fancytree({
|
||||
autoScroll: true,
|
||||
keyboard: false, // we takover keyboard handling in the hotkeys plugin
|
||||
extensions: utils.isMobile() ? ["clones"] : ["hotkeys", "dnd5", "clones"],
|
||||
extensions: utils.isMobile() ? ["dnd5", "clones"] : ["hotkeys", "dnd5", "clones"],
|
||||
source: treeData,
|
||||
scrollParent: this.$widget,
|
||||
minExpandLevel: 2, // root can't be collapsed
|
||||
@@ -83,6 +83,10 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
||||
const notePath = treeService.getNotePath(node);
|
||||
appContext.tabManager.openTabWithNote(notePath);
|
||||
}
|
||||
else if (data.node.isActive()) {
|
||||
// this is important for single column mobile view, otherwise it's not possible to see again previously displayed note
|
||||
this.tree.reactivate(true);
|
||||
}
|
||||
else {
|
||||
node.setActive();
|
||||
|
||||
@@ -100,6 +104,10 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
||||
|
||||
const activeTabContext = appContext.tabManager.getActiveTabContext();
|
||||
await activeTabContext.setNote(notePath);
|
||||
|
||||
if (utils.isMobile()) {
|
||||
this.triggerCommand('setActiveScreen', {screen:'detail'});
|
||||
}
|
||||
},
|
||||
expand: (event, data) => this.setExpandedToServer(data.node.data.branchId, true),
|
||||
collapse: (event, data) => this.setExpandedToServer(data.node.data.branchId, false),
|
||||
@@ -810,4 +818,8 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
||||
|
||||
noteCreateService.duplicateNote(noteId, branch.parentNoteId);
|
||||
}
|
||||
|
||||
activeScreenChangedEvent({activeScreen}) {
|
||||
this.toggle(activeScreen === 'tree');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user