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,21 +58,11 @@ 58 58 setSearchText(e) { 59 59 this.searchText = e.target.value; 60 60 } 61 - handleSearch(textSearch) { 62 - if(this.searchText !== "" || textSearch) { 61 + 62 + handleSearch() { 63 + if(this.searchText !== "") { 63 63 if(this.searchText !== this.prevSearchText) { 64 - this.clearResults(); 65 65 this.prevSearchText = this.searchText; 66 - this.fetchWikiSearch().then(results => { 67 - console.log(results); 68 - this.resultsCache = results; 69 - if(this.hasActiveFilters()) { 70 - this.fetchFilterSearch().then(this.filterResults); 71 - } else { 72 - this.results = results; 73 - } 74 - }) 75 - /* 76 76 Promise.all([ 77 77 this.fetchWikiSearch(), 78 78 this.fetchFilterSearch() ... ... @@ -81,7 +81,6 @@ 81 81 this.resultsCache = wikiSearchResults; 82 82 console.log(wikiSearchResults, collabSearchResults); 83 83 }); 84 - */ 85 85 } else if (this.searchText === this.prevSearchText && this.hasActiveFilters()) { 86 86 this.fetchFilterSearch().then(this.filterResults) 87 87 } else { ... ... @@ -128,7 +128,7 @@ 128 128 <div> 129 129 <div> 130 130 <input @change="${this.setSearchText}" type="text" placeholder="Search..." /> 131 - <button @click="${ () =>this.handleSearch(true)}">Search</button>120 + <button @click="${this.handleSearch}">Search</button> 132 132 </div> 133 133 <div> 134 134 <label><input type="checkbox" @change="${() => this.toggleRoleFilter('administrator')}" .checked="${this.administratorFilter}"/> Administrator</label>