Skip to content

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

Fix filters js

michal02b79b258e6d
diff --git a/saleor/static/js/storefront.js b/saleor/static/js/storefront.js
index f337969c87..739d9c1475 100644
--- a/saleor/static/js/storefront.js
+++ b/saleor/static/js/storefront.js
@@ -373,19 +373,19 @@ $closeMsg.on('click', (e) => {
$('.toggle-filter').each(function(){
- let icon = $(this).find('.collapse-filter-icon');
+ let icon = $(this).find('.collapse-filters-icon');
let ele = $(this).find('.filter-form-field');
- let filter_arrow_down = 'static/assets/chevron_down.svg';
- let filter_arrow_up = 'static/assets/chevron_up.svg';
+ let filter_arrow_down = '/static/assets/chevron_down.svg';
+ let filter_arrow_up = '/static/assets/chevron_up.svg';
- $(this).on('click', () => {
+ $(this).find('.filter-label').on('click', () => {
if(ele.css("display") == "block") {
ele.css("display", "none");
- icon.text('<img src=' + filter_arrow_down + '>');
+ icon.html('<img src="' + filter_arrow_down + '">');
} else {
ele.css("display", "block");
- icon.text('<img src=' + filter_arrow_up + '>');
+ icon.html('<img src="' + filter_arrow_up + '">');
}
});
})
diff --git a/templates/category/index.html b/templates/category/index.html
index 166b4c0992..6b3851c6f5 100644
--- a/templates/category/index.html
+++ b/templates/category/index.html
@@ -99,9 +99,9 @@
{% for field in filter.form %}
{% if field.label == 'Price' %}
<div class="toggle-filter product-filters__price-range">
- <h3>
+ <h3 class="filter-label">
{{ field.label }}
- <div id="{{ field.name }}-chevron" class="collapse-filters-icon">
+ <div class="collapse-filters-icon">
<img src="{% static "assets/chevron_up.svg" %}">
</div>
</h3>
@@ -112,7 +112,7 @@
{% elif field.label == 'Sort by' %}
{% else %}
<div class="toggle-filter">
- <h3>
+ <h3 class="filter-label">
{{ field.label }}
<div class="collapse-filters-icon">
<img src="{% static "assets/chevron_up.svg" %}">