Skip to content
Snippets Groups Projects
Unverified Commit 71ddd5d0 authored by gmurtaza00's avatar gmurtaza00 Committed by GitHub
Browse files

Fixed filter presentation on small screens (#3346)

Fixed filter presentation on small screen. It is close by default and
filters options will show when **filters** button is clicked.

Closes #3345
parent 6cd5230c
No related branches found
No related tags found
2 merge requests!18Fix application form submit button remaining disabled (#3483),!13Merge in v4.1.1
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
<button class="button button--filters js-toggle-filters">{% trans "Filters" %}</button> <button class="button button--filters js-toggle-filters">{% trans "Filters" %}</button>
{% endif %} {% endif %}
<button class="button button--filters js-toggle-filters" id="show-filters-button">{% trans "Filters" %}</button>
{% if use_search|default:False %} {% if use_search|default:False %}
<form action="{{ search_action }}" method="get" role="search" class="form form--search-desktop"> <form action="{{ search_action }}" method="get" role="search" class="form form--search-desktop">
<button class="button button--search" type="submit" aria-label="{% trans 'Search' %}"> <button class="button button--search" type="submit" aria-label="{% trans 'Search' %}">
......
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
$(window).resize(function resize() { $(window).resize(function resize() {
if ($(window).width() < 1024) { if ($(window).width() < 1024) {
// close the filters if open when reducing the window size // close the filters if open when reducing the window size
$('body').removeClass('filters-open'); $('.filters').removeClass('filters-open');
// update filter button text // update filter button text
$('.js-toggle-filters').text('Filters'); $('.js-toggle-filters').text('Filters');
...@@ -158,6 +158,13 @@ ...@@ -158,6 +158,13 @@
mobileFilterPadding(e.target); mobileFilterPadding(e.target);
}); });
} }
else {
$('.filters').addClass('filters-open');
}
}).trigger('resize'); }).trigger('resize');
$('#show-filters-button').on('click', () => {
$('.filters').addClass('filters-open');
});
})(jQuery); })(jQuery);
...@@ -61,3 +61,9 @@ ...@@ -61,3 +61,9 @@
background: transparent; background: transparent;
} }
} }
// stylelint-disable selector-max-id
#show-filters-button {
@include media-query(tablet-landscape) {
display: none;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment