mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
frontend now correctly changes folder status during moving / creating / deleting notes
This commit is contained in:
parent
20a1e71100
commit
db21db18e8
@ -289,6 +289,11 @@
|
||||
url: baseUrl + 'notes/' + node.key,
|
||||
type: 'DELETE',
|
||||
success: function(result) {
|
||||
if (node.getParent() != null && node.getParent().getChildren().length <= 1) {
|
||||
node.getParent().folder = false;
|
||||
node.getParent().renderTitle();
|
||||
}
|
||||
|
||||
node.remove();
|
||||
}
|
||||
});
|
||||
@ -325,6 +330,11 @@
|
||||
type: 'PUT',
|
||||
contentType: "application/json",
|
||||
success: function(result) {
|
||||
if (node.getParent() != null && node.getParent().getChildren().length <= 1) {
|
||||
node.getParent().folder = false;
|
||||
node.getParent().renderTitle();
|
||||
}
|
||||
|
||||
node.moveTo(node.getParent(), 'after');
|
||||
}
|
||||
});
|
||||
@ -342,6 +352,9 @@
|
||||
node.moveTo(prevSibling);
|
||||
|
||||
prevSibling.setExpanded(true);
|
||||
|
||||
prevSibling.folder = true;
|
||||
prevSibling.renderTitle();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -391,6 +404,9 @@
|
||||
}
|
||||
else {
|
||||
node.addChildren(newNode).setActive(true);
|
||||
|
||||
node.folder = true;
|
||||
node.renderTitle();
|
||||
}
|
||||
|
||||
message("Created!");
|
||||
|
Loading…
x
Reference in New Issue
Block a user