diff --git a/src/public/javascripts/mobile.js b/src/public/javascripts/mobile.js index 13d71b50d..659f3dc51 100644 --- a/src/public/javascripts/mobile.js +++ b/src/public/javascripts/mobile.js @@ -87,6 +87,8 @@ async function showTree() { }); } }); + + treeService.setTree($.ui.fancytree.getTree("#tree")); } $detail.on("click", ".note-menu-button", async e => { diff --git a/src/public/javascripts/services/sidebar.js b/src/public/javascripts/services/sidebar.js index 24bf629c4..523ec61bf 100644 --- a/src/public/javascripts/services/sidebar.js +++ b/src/public/javascripts/services/sidebar.js @@ -5,6 +5,7 @@ import splitService from "./split.js"; import optionService from "./options.js"; import server from "./server.js"; import noteDetailService from "./note_detail.js"; +import utils from "./utils.js"; const $sidebar = $("#right-pane"); const $sidebarContainer = $('#sidebar-container'); @@ -15,6 +16,10 @@ const $hideSidebarButton = $("#hide-sidebar-button"); optionService.waitForOptions().then(options => toggleSidebar(options.is('rightPaneVisible'))); function toggleSidebar(show) { + if (utils.isMobile()) { + return; + } + $sidebar.toggle(show); $showSidebarButton.toggle(!show); $hideSidebarButton.toggle(show); diff --git a/src/public/javascripts/services/tree.js b/src/public/javascripts/services/tree.js index 6197e17b7..c159fedc7 100644 --- a/src/public/javascripts/services/tree.js +++ b/src/public/javascripts/services/tree.js @@ -913,6 +913,10 @@ function getNodeByKey(key) { return tree.getNodeByKey(key); } +function setTree(treeInstance) { + tree = treeInstance; +} + keyboardActionService.setGlobalActionHandler('CollapseTree', () => collapseTree()); // don't use shortened form since collapseTree() accepts argument $collapseTreeButton.on('click', () => collapseTree()); @@ -949,5 +953,6 @@ export default { focusTree, scrollToActiveNote, duplicateNote, - getNodeByKey + getNodeByKey, + setTree }; \ No newline at end of file