created a specific widget for search result to add "no results" message

This commit is contained in:
zadam
2021-02-19 22:15:56 +01:00
parent 4160da70be
commit c94fb7a62d
5 changed files with 80 additions and 15 deletions

View File

@@ -23,11 +23,9 @@ const TPL = `
export default class NoteListWidget extends TabAwareWidget {
isEnabled() {
return super.isEnabled()
&& ['book', 'text', 'code'].includes(this.note.type)
&& this.note.mime !== 'text/x-sqlite;schema=trilium'
&& (
['book', 'search', 'code'].includes(this.note.type)
|| (this.note.type === 'text' && this.note.hasChildren())
)
&& this.note.hasChildren()
&& !this.note.hasLabel('hideChildrenOverview');
}
@@ -89,17 +87,6 @@ export default class NoteListWidget extends TabAwareWidget {
setTimeout(() => this.checkRenderStatus(), 100);
}
searchRefreshedEvent({tabId}) {
if (!this.isTab(tabId)) {
return;
}
this.noteIdRefreshed = this.noteId;
this.shownNoteId = null;
this.checkRenderStatus();
}
notesReloadedEvent({noteIds}) {
if (noteIds.includes(this.noteId)) {
this.refresh();