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