mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 19:49:01 +01:00 
			
		
		
		
	feat(book/table): display even if empty
This commit is contained in:
		
							parent
							
								
									dd379bf18d
								
							
						
					
					
						commit
						dcb4ebe5d9
					
				| @ -315,14 +315,38 @@ class NoteContext extends Component implements EventListener<"entitiesReloaded"> | ||||
|     } | ||||
| 
 | ||||
|     hasNoteList() { | ||||
|         return ( | ||||
|             this.note && | ||||
|             ["default", "contextual-help"].includes(this.viewScope?.viewMode ?? "") && | ||||
|             (this.note.hasChildren() || this.note.getLabelValue("viewType") === "calendar") && | ||||
|             ["book", "text", "code"].includes(this.note.type) && | ||||
|             this.note.mime !== "text/x-sqlite;schema=trilium" && | ||||
|             !this.note.isLabelTruthy("hideChildrenOverview") | ||||
|         ); | ||||
|         const note = this.note; | ||||
| 
 | ||||
|         if (!note) { | ||||
|             return false; | ||||
|         } | ||||
| 
 | ||||
|         if (!["default", "contextual-help"].includes(this.viewScope?.viewMode ?? "")) { | ||||
|             return false; | ||||
|         } | ||||
| 
 | ||||
|         // Some book types must always display a note list, even if no children.
 | ||||
|         if (["calendar", "table"].includes(note.getLabelValue("viewType") ?? "")) { | ||||
|             return true; | ||||
|         } | ||||
| 
 | ||||
|         if (!note.hasChildren()) { | ||||
|             return false; | ||||
|         } | ||||
| 
 | ||||
|         if (!["book", "text", "code"].includes(note.type)) { | ||||
|             return false; | ||||
|         } | ||||
| 
 | ||||
|         if (note.mime === "text/x-sqlite;schema=trilium") { | ||||
|             return false; | ||||
|         } | ||||
| 
 | ||||
|         if (note.isLabelTruthy("hideChildrenOverview")) { | ||||
|             return false; | ||||
|         } | ||||
| 
 | ||||
|         return true; | ||||
|     } | ||||
| 
 | ||||
|     async getTextEditor(callback?: GetTextEditorCallback) { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran