mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
fix tree loading on mobile interface, closes #839
This commit is contained in:
parent
bd8c078fb9
commit
1a49894adf
@ -87,6 +87,8 @@ async function showTree() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
treeService.setTree($.ui.fancytree.getTree("#tree"));
|
||||||
}
|
}
|
||||||
|
|
||||||
$detail.on("click", ".note-menu-button", async e => {
|
$detail.on("click", ".note-menu-button", async e => {
|
||||||
|
@ -5,6 +5,7 @@ import splitService from "./split.js";
|
|||||||
import optionService from "./options.js";
|
import optionService from "./options.js";
|
||||||
import server from "./server.js";
|
import server from "./server.js";
|
||||||
import noteDetailService from "./note_detail.js";
|
import noteDetailService from "./note_detail.js";
|
||||||
|
import utils from "./utils.js";
|
||||||
|
|
||||||
const $sidebar = $("#right-pane");
|
const $sidebar = $("#right-pane");
|
||||||
const $sidebarContainer = $('#sidebar-container');
|
const $sidebarContainer = $('#sidebar-container');
|
||||||
@ -15,6 +16,10 @@ const $hideSidebarButton = $("#hide-sidebar-button");
|
|||||||
optionService.waitForOptions().then(options => toggleSidebar(options.is('rightPaneVisible')));
|
optionService.waitForOptions().then(options => toggleSidebar(options.is('rightPaneVisible')));
|
||||||
|
|
||||||
function toggleSidebar(show) {
|
function toggleSidebar(show) {
|
||||||
|
if (utils.isMobile()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$sidebar.toggle(show);
|
$sidebar.toggle(show);
|
||||||
$showSidebarButton.toggle(!show);
|
$showSidebarButton.toggle(!show);
|
||||||
$hideSidebarButton.toggle(show);
|
$hideSidebarButton.toggle(show);
|
||||||
|
@ -913,6 +913,10 @@ function getNodeByKey(key) {
|
|||||||
return tree.getNodeByKey(key);
|
return tree.getNodeByKey(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setTree(treeInstance) {
|
||||||
|
tree = treeInstance;
|
||||||
|
}
|
||||||
|
|
||||||
keyboardActionService.setGlobalActionHandler('CollapseTree', () => collapseTree()); // don't use shortened form since collapseTree() accepts argument
|
keyboardActionService.setGlobalActionHandler('CollapseTree', () => collapseTree()); // don't use shortened form since collapseTree() accepts argument
|
||||||
$collapseTreeButton.on('click', () => collapseTree());
|
$collapseTreeButton.on('click', () => collapseTree());
|
||||||
|
|
||||||
@ -949,5 +953,6 @@ export default {
|
|||||||
focusTree,
|
focusTree,
|
||||||
scrollToActiveNote,
|
scrollToActiveNote,
|
||||||
duplicateNote,
|
duplicateNote,
|
||||||
getNodeByKey
|
getNodeByKey,
|
||||||
|
setTree
|
||||||
};
|
};
|
Loading…
x
Reference in New Issue
Block a user