mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Add second Search button on mobile (#14404)
This commit is contained in:
parent
ed0b6a3660
commit
3e3043dbaa
@ -411,8 +411,8 @@ export default Controller.extend({
|
||||
this.selected.clear();
|
||||
},
|
||||
|
||||
search(collapseFilters = false) {
|
||||
if (collapseFilters) {
|
||||
search(options = {}) {
|
||||
if (options.collapseFilters) {
|
||||
document
|
||||
.querySelector("details.advanced-filters")
|
||||
?.removeAttribute("open");
|
||||
|
@ -228,4 +228,17 @@
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
{{#if site.mobileView}}
|
||||
<div class="second-search-button">
|
||||
{{d-button
|
||||
action=search
|
||||
icon="search"
|
||||
label="search.search_button"
|
||||
class="btn-primary search-cta"
|
||||
ariaLabel="search.search_button"
|
||||
disabled=searchButtonDisabled
|
||||
}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
@ -16,7 +16,7 @@
|
||||
value=searchTerm
|
||||
class="full-page-search search no-blur search-query"
|
||||
aria-label=(i18n "search.search_term_label")
|
||||
enter=(action "search" true)
|
||||
enter=(action "search" (hash collapseFilters=true))
|
||||
hasAutofocus=hasAutofocus
|
||||
aria-controls="search-result-count"
|
||||
}}
|
||||
@ -28,7 +28,7 @@
|
||||
onChange=(action (mut search_type))
|
||||
}}
|
||||
{{d-button
|
||||
action=(action "search" true)
|
||||
action=(action "search" (hash collapseFilters=true))
|
||||
icon="search"
|
||||
label="search.search_button"
|
||||
class="btn-primary search-cta"
|
||||
@ -50,6 +50,8 @@
|
||||
{{search-advanced-options
|
||||
searchTerm=(readonly searchTerm)
|
||||
onChangeSearchTerm=(action (mut searchTerm))
|
||||
search=(action "search" (hash collapseFilters=true))
|
||||
searchButtonDisabled=searchButtonDisabled
|
||||
expandFilters=expandFilters
|
||||
}}
|
||||
</div>
|
||||
|
@ -3,4 +3,12 @@
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.second-search-button {
|
||||
margin-top: 1em;
|
||||
display: flex;
|
||||
.btn {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user