mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	small fixes
This commit is contained in:
		| @@ -32,7 +32,7 @@ UPDATE notes SET noteId = '_hidden' WHERE noteId = 'hidden'; | ||||
| UPDATE note_contents SET noteId = '_hidden' WHERE noteId = 'hidden'; | ||||
| UPDATE note_revisions SET noteId = '_hidden' WHERE noteId = 'hidden'; | ||||
| UPDATE branches SET noteId = '_hidden' WHERE noteId = 'hidden'; | ||||
| UPDATE branches SET branchId = '_hidden' WHERE branchId = 'hidden'; | ||||
| UPDATE branches SET branchId = '_hidden', prefix = NULL WHERE branchId = 'hidden'; | ||||
| UPDATE branches SET parentNoteId = '_hidden' WHERE parentNoteId = 'hidden'; | ||||
| UPDATE attributes SET noteId = '_hidden' WHERE noteId = 'hidden'; | ||||
| UPDATE attributes SET value = '_hidden' WHERE type = 'relation' AND value = 'hidden'; | ||||
|   | ||||
| @@ -1 +1,3 @@ | ||||
| <p>Hidden tree is used to record various application-level data which can stay most of the time hidden from the user view.</p> | ||||
| <p>Hidden tree is used to record various application-level data which can stay most of the time hidden from the user view.</p> | ||||
|  | ||||
| <p>Make sure you know what you're doing. Incorrect changes in this subtree might potentially crash the application.</p> | ||||
|   | ||||
							
								
								
									
										1
									
								
								src/public/app/doc_notes/user_hidden.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								src/public/app/doc_notes/user_hidden.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| <p>This note serves as a subtree reserved for data produced by user scripts which should otherwise not freely create data in the hidden subtree.</p> | ||||
| @@ -371,7 +371,15 @@ export default class NoteTreeWidget extends NoteContextAwareWidget { | ||||
|             }, | ||||
|             beforeActivate: (event, data) => { | ||||
|                 // hidden subtree is hidden hackily, prevent activating it e.g. by keyboard | ||||
|                 return hoistedNoteService.getHoistedNoteId() === '_hidden' || data.node.data.noteId !== '_hidden'; | ||||
|  | ||||
|                 if (hoistedNoteService.getHoistedNoteId() === '_hidden') { | ||||
|                     // if we're hoisted in hidden subtree, we want to avoid crossing to "visible" tree, | ||||
|                     // which could happen via UP key from hidden root (to another top level note) | ||||
|                     return data.node.data.noteId === '_hidden' || data.node.getParent().data.noteId !== 'root'; | ||||
|                 } | ||||
|  | ||||
|                 // we're not hoisted to hidden subtree, the only way to cross is via DOWN key to the hidden root | ||||
|                 return data.node.data.noteId !== '_hidden'; | ||||
|             }, | ||||
|             activate: async (event, data) => { | ||||
|                 // click event won't propagate so let's close context menu manually | ||||
|   | ||||
| @@ -20,7 +20,8 @@ const HIDDEN_SUBTREE_DEFINITION = { | ||||
|     // over tree when it's in the middle | ||||
|     notePosition: 999_999_999, | ||||
|     attributes: [ | ||||
|         { type: 'label', name: 'excludeFromNoteMap', isInheritable: true } | ||||
|         { type: 'label', name: 'excludeFromNoteMap', isInheritable: true }, | ||||
|         { type: 'label', name: 'docName', value: 'hidden' } | ||||
|     ], | ||||
|     children: [ | ||||
|         { | ||||
| @@ -47,7 +48,7 @@ const HIDDEN_SUBTREE_DEFINITION = { | ||||
|             id: '_share', | ||||
|             title: 'Shared Notes', | ||||
|             type: 'doc', | ||||
|             attributes: [ { type: 'label', name: 'docName', value: '_share' } ] | ||||
|             attributes: [ { type: 'label', name: 'docName', value: 'share' } ] | ||||
|         }, | ||||
|         { | ||||
|             id: '_bulkAction', | ||||
| @@ -67,7 +68,8 @@ const HIDDEN_SUBTREE_DEFINITION = { | ||||
|             // place for user scripts hidden stuff (scripts should not create notes directly under hidden root) | ||||
|             id: '_userHidden', | ||||
|             title: 'User Hidden', | ||||
|             type: 'text', | ||||
|             type: 'doc', | ||||
|             attributes: [ { type: 'label', name: 'docName', value: 'user_hidden' } ] | ||||
|         }, | ||||
|         { | ||||
|             id: LBTPL_ROOT, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user