refactoring utils into module

This commit is contained in:
azivner
2018-03-24 23:37:55 -04:00
parent 0f6b00e1c8
commit c8e456cdb1
21 changed files with 361 additions and 340 deletions

View File

@@ -4,7 +4,7 @@ const treeUtils = (function() {
const $tree = $("#tree");
function getParentProtectedStatus(node) {
return isTopLevelNode(node) ? 0 : node.getParent().data.isProtected;
return utils.isTopLevelNode(node) ? 0 : node.getParent().data.isProtected;
}
function getNodeByKey(key) {
@@ -20,7 +20,7 @@ const treeUtils = (function() {
function getNotePath(node) {
const path = [];
while (node && !isRootNode(node)) {
while (node && !utils.isRootNode(node)) {
if (node.data.noteId) {
path.push(node.data.noteId);
}