|
|
|
@ -1,5 +1,8 @@
|
|
|
|
$(function(){
|
|
|
|
$(function(){
|
|
|
|
$.get(baseUrl + 'tree').then(notes => {
|
|
|
|
$.get(baseUrl + 'tree').then(resp => {
|
|
|
|
|
|
|
|
const notes = resp.notes;
|
|
|
|
|
|
|
|
const startNoteId = resp.start_note_id;
|
|
|
|
|
|
|
|
|
|
|
|
function copyTitle(notes) {
|
|
|
|
function copyTitle(notes) {
|
|
|
|
for (let note of notes) {
|
|
|
|
for (let note of notes) {
|
|
|
|
note.title = note.note_title;
|
|
|
|
note.title = note.note_title;
|
|
|
|
@ -33,6 +36,7 @@ $(function(){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$("#tree").fancytree({
|
|
|
|
$("#tree").fancytree({
|
|
|
|
|
|
|
|
autoScroll: true,
|
|
|
|
extensions: ["hotkeys"],
|
|
|
|
extensions: ["hotkeys"],
|
|
|
|
source: notes,
|
|
|
|
source: notes,
|
|
|
|
activate: function(event, data){
|
|
|
|
activate: function(event, data){
|
|
|
|
@ -47,6 +51,13 @@ $(function(){
|
|
|
|
collapse: function(event, data) {
|
|
|
|
collapse: function(event, data) {
|
|
|
|
setExpanded(data.node.key, false);
|
|
|
|
setExpanded(data.node.key, false);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
init: function(event, data) {
|
|
|
|
|
|
|
|
console.log("Activating...");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (startNoteId) {
|
|
|
|
|
|
|
|
data.tree.activateKey(startNoteId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
hotkeys: {
|
|
|
|
hotkeys: {
|
|
|
|
keydown: {
|
|
|
|
keydown: {
|
|
|
|
"insert": function(node) {
|
|
|
|
"insert": function(node) {
|
|
|
|
|