Changes for page Context Search
Last modified by bougault on 2023/02/20 16:29
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -58,11 +58,16 @@ 58 58 setSearchText(e) { 59 59 this.searchText = e.target.value; 60 60 } 61 - handleSearch() { 62 - 63 - if(this.searchText !== "") { 61 + handleSearch(textSearch) { 62 + if(this.searchText !== "" || textSearch) { 64 64 if(this.searchText !== this.prevSearchText) { 65 65 this.prevSearchText = this.searchText; 65 + this.fetchWikiSearch().then(results => { 66 + this.results = wikiSearchResults; 67 + this.resultsCache = wikiSearchResults; 68 + this.fetchFilterSearch().then(this.filterResults); 69 + }) 70 + /* 66 66 Promise.all([ 67 67 this.fetchWikiSearch(), 68 68 this.fetchFilterSearch() ... ... @@ -71,6 +71,7 @@ 71 71 this.resultsCache = wikiSearchResults; 72 72 console.log(wikiSearchResults, collabSearchResults); 73 73 }); 79 + */ 74 74 } else if (this.searchText === this.prevSearchText && this.hasActiveFilters()) { 75 75 this.fetchFilterSearch().then(this.filterResults) 76 76 } else { ... ... @@ -117,7 +117,7 @@ 117 117 <div> 118 118 <div> 119 119 <input @change="${this.setSearchText}" type="text" placeholder="Search..." /> 120 - <button @click="${this.handleSearch}">Search</button> 126 + <button @click="${() => this.handleSearch(true)}">Search</button> 121 121 </div> 122 122 <div> 123 123 <label><input type="checkbox" @change="${() => this.toggleRoleFilter('administrator')}" .checked="${this.administratorFilter}"/> Administrator</label>