refactoring of tree handling to recommended fancytree

This commit is contained in:
zadam
2020-01-03 21:15:45 +01:00
parent 10219fb9dd
commit 94a0a31f17
7 changed files with 44 additions and 46 deletions

View File

@@ -2,16 +2,10 @@ import utils from './utils.js';
import hoistedNoteService from './hoisted_note.js';
import treeCache from "./tree_cache.js";
const $tree = $("#tree");
async function getParentProtectedStatus(node) {
return await hoistedNoteService.isRootNode(node) ? 0 : node.getParent().data.isProtected;
}
function getNodeByKey(key) {
return $tree.fancytree('getNodeByKey', key);
}
function getNoteIdFromNotePath(notePath) {
if (!notePath) {
return null;
@@ -123,7 +117,6 @@ async function getNotePathTitle(notePath) {
export default {
getParentProtectedStatus,
getNodeByKey,
getNotePath,
getNoteIdFromNotePath,
getNoteIdAndParentIdFromNotePath,