mobile frontend is working again

This commit is contained in:
zadam
2020-03-01 15:19:16 +01:00
parent f15239c006
commit 0f4ba43463
8 changed files with 58 additions and 105 deletions

View File

@@ -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');
}
}