DEV: Close search menu after advanced search is clicked (#26108)

This commit is contained in:
Isaac Janzen 2024-03-08 15:34:11 -07:00 committed by GitHub
parent f71e9aad60
commit 9484174f32
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 16 additions and 9 deletions

View File

@ -46,7 +46,9 @@
{{#if this.search.activeGlobalSearchTerm}}
<SearchMenu::ClearButton @clearSearch={{this.clearSearch}} />
{{/if}}
<SearchMenu::AdvancedButton @href={{this.advancedSearchButtonHref}} />
<SearchMenu::AdvancedButton
@openAdvancedSearch={{this.openAdvancedSearch}}
/>
</div>
{{/if}}
</div>

View File

@ -146,8 +146,10 @@ export default class SearchMenu extends Component {
return getURL(url);
}
get advancedSearchButtonHref() {
return this.fullSearchUrl({ expanded: true });
@action
openAdvancedSearch() {
this.fullSearch();
this.close();
}
get displayMenuPanelResults() {

View File

@ -1,7 +1,6 @@
<a
<DButton
class="show-advanced-search"
title={{i18n "search.open_advanced"}}
href={{@href}}
>
{{d-icon "sliders-h"}}
</a>
@action={{@openAdvancedSearch}}
@icon="sliders-h"
/>

View File

@ -90,6 +90,10 @@ acceptance("Search - Anonymous", function (needs) {
"it goes to full search page and preserves the search term"
);
assert
.dom(".search-menu .search-menu-panel")
.doesNotExist("closes search menu after clicking advanced search button");
assert.ok(
exists(".search-advanced-options"),
"advanced search is expanded"

View File

@ -350,7 +350,7 @@ $search-pad-horizontal: 0.5em;
margin-top: 2px;
}
a.show-advanced-search,
.show-advanced-search,
a.clear-search {
padding: 0px 3px;
display: inline-block;