Skip to content

Build your personal knowledge base with Trilium Notes

fix demo document word count widget with contain: none

zadam4eb9ca7b4643
diff --git a/db/demo.zip b/db/demo.zip
index 3552a3888a..9fc33e2b4a 100644
Binary files a/db/demo.zip and b/db/demo.zip differ
diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.js
index 7a7f445cc9..f0627db58d 100644
--- a/src/public/app/widgets/note_tree.js
+++ b/src/public/app/widgets/note_tree.js
@@ -369,8 +369,7 @@ export default class NoteTreeWidget extends TabAwareWidget {
data.dataTransfer.setData("text", JSON.stringify(notes));
return true; // allow dragging to start
},
- dragEnter: (node, data) => true, // allow drop on any node
- dragOver: (node, data) => true,
+ dragEnter: (node, data) => node.data.noteType !== 'search',
dragDrop: async (node, data) => {
if ((data.hitMode === 'over' && node.data.noteType === 'search') ||
(['after', 'before'].includes(data.hitMode)
@@ -1154,6 +1153,12 @@ export default class NoteTreeWidget extends TabAwareWidget {
utils.assertArguments(branchId);
const branch = treeCache.getBranch(branchId);
+
+ if (!branch) {
+ // in case of virtual branches there's nothing to update
+ return;
+ }
+
branch.isExpanded = isExpanded;
await server.put(`branches/${branchId}/expanded/${isExpanded ? 1 : 0}`);