Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add mobile filter menu opening

dominik-zeglencb60a3875baf
diff --git a/saleor/static/js/storefront.js b/saleor/static/js/storefront.js
index a7329a4b2a..65846be2aa 100644
--- a/saleor/static/js/storefront.js
+++ b/saleor/static/js/storefront.js
@@ -139,6 +139,19 @@ $(document).ready((e) => {
});
});
+// Mobile filters menu
+
+$(document).ready((e) => {
+ $('.filters-menu').on('click', (e) => {
+ const t = $('.filters-menu__body');
+ if(t.hasClass('d-none')) {
+ t.removeClass('d-none');
+ } else {
+ t.addClass('d-none');
+ }
+ });
+});
+
// Input Passwords
let $inputPassword = $('input[type=password]');
diff --git a/saleor/static/scss/components/_header.scss b/saleor/static/scss/components/_header.scss
index 0df22375b0..d97e1fc1cf 100644
--- a/saleor/static/scss/components/_header.scss
+++ b/saleor/static/scss/components/_header.scss
@@ -202,7 +202,7 @@
background-color: $white;
padding-left: 0;
padding-right: $global-padding;
- padding-top: $global-padding * 2;
+ padding-top: $global-padding * 5;
transition: 0.3s ease-in-out;
ul {
text-align: left;
diff --git a/templates/category/index.html b/templates/category/index.html
index 39c4e88a68..872406b96a 100644
--- a/templates/category/index.html
+++ b/templates/category/index.html
@@ -42,7 +42,7 @@
<div class="col-md-5">
<div class="row">
<div class="col-6 col-md-2 col-lg-6 filters-menu">
-
+ <span class="filters-menu__label d-sm-none">Filters</span>
</div>
<div class="col-6 col-md-10 col-lg-6">
<div class="sort-by">
@@ -136,7 +136,7 @@
</ul>
</div>
</div>
- <div>
+ <div class="filters-menu__body d-none">
<h2>
{% trans 'Filters' context 'Filter heading title' %}
<a href="?">