mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Close search menu after advanced search is clicked (#26108)
This commit is contained in:
parent
f71e9aad60
commit
9484174f32
@ -46,7 +46,9 @@
|
|||||||
{{#if this.search.activeGlobalSearchTerm}}
|
{{#if this.search.activeGlobalSearchTerm}}
|
||||||
<SearchMenu::ClearButton @clearSearch={{this.clearSearch}} />
|
<SearchMenu::ClearButton @clearSearch={{this.clearSearch}} />
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<SearchMenu::AdvancedButton @href={{this.advancedSearchButtonHref}} />
|
<SearchMenu::AdvancedButton
|
||||||
|
@openAdvancedSearch={{this.openAdvancedSearch}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -146,8 +146,10 @@ export default class SearchMenu extends Component {
|
|||||||
return getURL(url);
|
return getURL(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
get advancedSearchButtonHref() {
|
@action
|
||||||
return this.fullSearchUrl({ expanded: true });
|
openAdvancedSearch() {
|
||||||
|
this.fullSearch();
|
||||||
|
this.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
get displayMenuPanelResults() {
|
get displayMenuPanelResults() {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<a
|
<DButton
|
||||||
class="show-advanced-search"
|
class="show-advanced-search"
|
||||||
title={{i18n "search.open_advanced"}}
|
title={{i18n "search.open_advanced"}}
|
||||||
href={{@href}}
|
@action={{@openAdvancedSearch}}
|
||||||
>
|
@icon="sliders-h"
|
||||||
{{d-icon "sliders-h"}}
|
/>
|
||||||
</a>
|
|
@ -90,6 +90,10 @@ acceptance("Search - Anonymous", function (needs) {
|
|||||||
"it goes to full search page and preserves the search term"
|
"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(
|
assert.ok(
|
||||||
exists(".search-advanced-options"),
|
exists(".search-advanced-options"),
|
||||||
"advanced search is expanded"
|
"advanced search is expanded"
|
||||||
|
@ -350,7 +350,7 @@ $search-pad-horizontal: 0.5em;
|
|||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.show-advanced-search,
|
.show-advanced-search,
|
||||||
a.clear-search {
|
a.clear-search {
|
||||||
padding: 0px 3px;
|
padding: 0px 3px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
Loading…
Reference in New Issue
Block a user