fix search

This commit is contained in:
zadam
2021-07-02 23:22:10 +02:00
parent 1e767482b4
commit 4cc02ffb31
5 changed files with 28 additions and 29 deletions
+1 -3
View File
@@ -187,7 +187,7 @@ class Froca {
}
const branches = [...note.getBranches(), ...note.getChildBranches()];
console.log("searchResultNoteIds", searchResultNoteIds);
searchResultNoteIds.forEach((resultNoteId, index) => branches.push({
// branchId should be repeatable since sometimes we reload some notes without rerendering the tree
branchId: "virt-" + note.noteId + '-' + resultNoteId,
@@ -197,8 +197,6 @@ console.log("searchResultNoteIds", searchResultNoteIds);
fromSearchNote: true
}));
console.log("branches", branches);
// update this note with standard (parent) branches + virtual (children) branches
this.addResp({
notes: [note],
+2 -2
View File
@@ -33,7 +33,7 @@ const TPL = `
<button class="btn btn-outline-secondary search-button" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="bx bx-search"></span>
</button>
<div class="dropdown-menu dropdown-menu-right"></div>
<div class="dropdown-menu dropdown-menu-left"></div>
</div>
<input type="text" class="form-control form-control-sm search-string" placeholder="Quick search">
</div>
@@ -50,7 +50,7 @@ export default class QuickSearchWidget extends BasicWidget {
this.$dropdownToggle = this.$widget.find('.search-button');
this.$dropdownToggle.dropdown();
this.$widget.find('.input-group-append').on('shown.bs.dropdown', () => this.search());
this.$widget.find('.input-group-prepend').on('shown.bs.dropdown', () => this.search());
utils.bindElShortcut(this.$searchString, 'return', () => {
if (this.$dropdownMenu.is(":visible")) {
+1
View File
@@ -41,6 +41,7 @@ export default class SearchResultWidget extends NoteContextAwareWidget {
doRender() {
this.$widget = $(TPL);
this.contentSized();
this.$content = this.$widget.find('.search-result-widget-content');
this.$noResults = this.$widget.find('.search-no-results');
this.$notExecutedYet = this.$widget.find('.search-not-executed-yet');