|
39 | 39 | <div class="facets__display">
|
40 | 40 | <div class="facets__header">
|
41 | 41 | <span class="facets__selected no-js-hidden">{{ 'sections.collection_template.filters_selected' | t: count: filter.active_values.size }}</span>
|
42 |
| - <a href="{{ filter.url_to_remove }}" class="facets__reset link underlined-link js-facet-remove" >{{ 'sections.collection_template.reset' | t }}</a> |
| 42 | + <facet-remove> |
| 43 | + <a href="{{ filter.url_to_remove }}" class="facets__reset link underlined-link"> |
| 44 | + {{ 'sections.collection_template.reset' | t }} |
| 45 | + </a> |
| 46 | + </facet-remove> |
43 | 47 | </div>
|
44 | 48 |
|
45 | 49 | <ul class="facets__list list-unstyled" role="list">
|
|
58 | 62 | <rect width="16" height="16" stroke="currentColor" fill="none" stroke-width="1"></rect>
|
59 | 63 | </svg>
|
60 | 64 |
|
61 |
| - <svg class="icon icon-checkmark" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 9" fill="none" width="10px" height="10px"> |
62 |
| - <path fill-rule="evenodd" clip-rule="evenodd" d="M11.35.643a.5.5 0 01.006.707l-6.77 6.886a.5.5 0 01-.719-.006L.638 4.845a.5.5 0 11.724-.69l2.872 3.011 6.41-6.517a.5.5 0 01.707-.006h-.001z" fill="currentColor"/> |
| 65 | + <svg class="icon icon-checkmark" |
| 66 | + width="11" |
| 67 | + height="7" |
| 68 | + viewBox="0 0 11 7" |
| 69 | + fill="none" |
| 70 | + xmlns="http://www.w3.org/2000/svg"> |
| 71 | + |
| 72 | + <path d="M1.5 3.5L2.83333 4.75L4.16667 6L9.5 1" |
| 73 | + stroke="currentColor" |
| 74 | + stroke-width="1.75" |
| 75 | + stroke-linecap="round" |
| 76 | + stroke-linejoin="round" /> |
| 77 | + </svg> |
| 78 | + |
63 | 79 | </svg>
|
64 | 80 | {{ value.label | escape }} ({{ value.count }})
|
65 | 81 | </label>
|
|
88 | 104 | <div class="facets__header">
|
89 | 105 | {%- assign max_price_amount = filter.range_max | money | escape -%}
|
90 | 106 | <span class="facets__selected">{{ "sections.collection_template.max_price" | t: price: max_price_amount }}</span>
|
91 |
| - <a href="{{ filter.url_to_remove }}" class="facets__reset link underlined-link js-facet-remove" >{{ 'sections.collection_template.reset' | t }}</a> |
| 107 | + <facet-remove> |
| 108 | + <a href="{{ filter.url_to_remove }}" class="facets__reset link underlined-link" > |
| 109 | + {{ 'sections.collection_template.reset' | t }} |
| 110 | + </a> |
| 111 | + </facet-remove> |
92 | 112 | </div>
|
93 | 113 | <price-range class="facets__price">
|
94 | 114 | <div class="field">
|
|
140 | 160 | </div>
|
141 | 161 |
|
142 | 162 | <div class="active-facets active-facets-desktop">
|
143 |
| - <a href="{{ collection.url }}?sort_by={{ sort_by }}" class="active-facets__button js-facet-remove"> |
144 |
| - <span class="active-facets__button-inner button button--secondary">{{ 'sections.collection_template.clear_all' | t }}</span> |
145 |
| - </a> |
| 163 | + <facet-remove> |
| 164 | + <a href="{{ collection.url }}?sort_by={{ sort_by }}" class="active-facets__button"> |
| 165 | + <span class="active-facets__button-inner button button--secondary">{{ 'sections.collection_template.clear_all' | t }}</span> |
| 166 | + </a> |
| 167 | + </facet-remove> |
146 | 168 | {%- for filter in collection.filters -%}
|
147 | 169 | {%- for value in filter.active_values -%}
|
148 |
| - <a class="active-facets__button active-facets__button--light js-facet-remove" href="{{ value.url_to_remove }}"> |
149 |
| - <span class="active-facets__button-inner button button--tertiary"> |
150 |
| - {{ value.label | escape }} |
151 |
| - {% render 'icon-close-small' %} |
152 |
| - </span> |
153 |
| - </a> |
154 |
| - {%- endfor -%} |
155 |
| - {% if filter.type == "price_range" %} |
156 |
| - {%- if filter.min_value.value != nil or filter.max_value.value != nil -%} |
157 |
| - <a class="active-facets__button active-facets__button--light js-facet-remove" href="{{ filter.url_to_remove }}"> |
| 170 | + <facet-remove> |
| 171 | + <a href="{{ value.url_to_remove }}" class="active-facets__button active-facets__button--light"> |
158 | 172 | <span class="active-facets__button-inner button button--tertiary">
|
159 |
| - {%- if filter.min_value.value -%}{{ filter.min_value.value | money }}{%- else -%}{{ 0 | money }}{%- endif -%}-{%- if filter.max_value.value -%}{{ filter.max_value.value | money }}{%- else -%}{{ filter.range_max | money }}{%- endif -%} |
| 173 | + {{ value.label | escape }} |
160 | 174 | {% render 'icon-close-small' %}
|
161 | 175 | </span>
|
162 | 176 | </a>
|
| 177 | + </facet-remove> |
| 178 | + {%- endfor -%} |
| 179 | + {% if filter.type == "price_range" %} |
| 180 | + {%- if filter.min_value.value != nil or filter.max_value.value != nil -%} |
| 181 | + <facet-remove> |
| 182 | + <a href="{{ filter.url_to_remove }}" class="active-facets__button active-facets__button--light"> |
| 183 | + <span class="active-facets__button-inner button button--tertiary"> |
| 184 | + {%- if filter.min_value.value -%}{{ filter.min_value.value | money }}{%- else -%}{{ 0 | money }}{%- endif -%}-{%- if filter.max_value.value -%}{{ filter.max_value.value | money }}{%- else -%}{{ filter.range_max | money }}{%- endif -%} |
| 185 | + {% render 'icon-close-small' %} |
| 186 | + </span> |
| 187 | + </a> |
| 188 | + </facet-remove> |
163 | 189 | {%- endif -%}
|
164 | 190 | {% endif %}
|
165 | 191 | {%- endfor -%}
|
|
237 | 263 | {%- for value in filter.values -%}
|
238 | 264 | <li class="mobile-facets__item list-menu__item">
|
239 | 265 | <label for="Filter-{{ filter.label | escape }}-mobile-{{ forloop.index }}" class="mobile-facets__label{% if value.count == 0 and value.active == false %} mobile-facets__label--disabled{% endif %}">
|
240 |
| - <input class="mobile-facets__checkbox" |
241 |
| - type="checkbox" |
242 |
| - name="{{ value.param_name }}" |
243 |
| - value="{{ value.value }}" |
244 |
| - id="Filter-{{ filter.label | escape }}-mobile-{{ forloop.index }}" |
| 266 | + <input class="mobile-facets__checkbox" type="checkbox" name="{{ value.param_name }}" value="{{ value.value }}" id="Filter-{{ filter.label | escape }}-mobile-{{ forloop.index }}" |
245 | 267 | {% if value.active %}checked{% endif %}
|
246 | 268 | {% if value.count == 0 and value.active == false %}disabled{% endif %}
|
247 | 269 | >
|
|
252 | 274 | <rect width="16" height="16" stroke="currentColor" fill="none" stroke-width="1"></rect>
|
253 | 275 | </svg>
|
254 | 276 |
|
255 |
| - <svg class="icon icon-checkmark" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 9" fill="none" width="10px" height="10px"> |
256 |
| - <path fill-rule="evenodd" clip-rule="evenodd" d="M11.35.643a.5.5 0 01.006.707l-6.77 6.886a.5.5 0 01-.719-.006L.638 4.845a.5.5 0 11.724-.69l2.872 3.011 6.41-6.517a.5.5 0 01.707-.006h-.001z" fill="currentColor"/> |
| 277 | + <svg class="icon icon-checkmark" width="11" height="7" viewBox="0 0 11 7" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 278 | + <path d="M1.5 3.5L2.83333 4.75L4.16667 6L9.5 1" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> |
257 | 279 | </svg>
|
258 | 280 |
|
259 | 281 | {{ value.label | escape }} ({{ value.count }})
|
|
263 | 285 | </ul>
|
264 | 286 |
|
265 | 287 | <div class="no-js-hidden mobile-facets__footer">
|
266 |
| - <a href="{{ collection.url }}" class="mobile-facets__clear button button--secondary js-facet-remove">{{ 'sections.collection_template.clear' | t }}</a> |
| 288 | + <facet-remove> |
| 289 | + <a href="{{ collection.url }}" class="mobile-facets__clear button button--secondary">{{ 'sections.collection_template.clear' | t }}</a> |
| 290 | + </facet-remove> |
267 | 291 | <button type="button" class="no-js-hidden button button--primary" onclick="this.closest('.mobile-facets__wrapper').querySelector('summary').click()">{{ 'sections.collection_template.apply' | t }}</button>
|
268 | 292 | <noscript><button class="button button--primary">{{ 'sections.collection_template.apply' | t }}</button></noscript>
|
269 | 293 | </div>
|
|
351 | 375 | {%- endif -%}
|
352 | 376 |
|
353 | 377 | <div class="mobile-facets__footer">
|
354 |
| - <a href="{{ collection.url }}" class="mobile-facets__clear button button--secondary js-facet-remove">{{ 'sections.collection_template.clear' | t }}</a> |
| 378 | + <facet-remove> |
| 379 | + <a href="{{ collection.url }}" class="mobile-facets__clear button button--secondary">{{ 'sections.collection_template.clear' | t }}</a> |
| 380 | + </facet-remove> |
355 | 381 | <button type="button" class="no-js-hidden button button--primary" onclick="this.closest('.mobile-facets__wrapper').querySelector('summary').click()">{{ 'sections.collection_template.apply' | t }}</button>
|
356 | 382 | <noscript><button class="button button--primary">{{ 'sections.collection_template.apply' | t }}</button></noscript>
|
357 | 383 | </div>
|
|
367 | 393 | </menu-drawer>
|
368 | 394 |
|
369 | 395 | <div class="active-facets active-facets-mobile">
|
370 |
| - <a href="{{ collection.url }}?sort_by={{ sort_by }}" class="active-facets__button js-facet-remove"> |
371 |
| - <span class="active-facets__button-inner button button--secondary"> |
372 |
| - {{ 'sections.collection_template.clear_all' | t }} |
373 |
| - </span> |
374 |
| - </a> |
| 396 | + <facet-remove> |
| 397 | + <a href="{{ collection.url }}?sort_by={{ sort_by }}" class="active-facets__button"> |
| 398 | + <span class="active-facets__button-inner button button--secondary"> |
| 399 | + {{ 'sections.collection_template.clear_all' | t }} |
| 400 | + </span> |
| 401 | + </a> |
| 402 | + </facet-remove> |
375 | 403 | {%- for filter in collection.filters -%}
|
376 | 404 | {%- for value in filter.active_values -%}
|
377 |
| - <a class="active-facets__button active-facets__button--light js-facet-remove" href="{{ value.url_to_remove }}"> |
378 |
| - <span class="active-facets__button-inner button button--tertiary"> |
379 |
| - {{ value.label | escape }} |
380 |
| - {% render 'icon-close-small' %} |
381 |
| - </span> |
382 |
| - </a> |
383 |
| - {%- endfor -%} |
384 |
| - |
385 |
| - {% if filter.type == "price_range" %} |
386 |
| - {%- if filter.min_value.value != nil or filter.max_value.value != nil -%} |
387 |
| - <a class="active-facets__button active-facets__button--light button button--tertiary js-facet-remove" href="{{ filter.url_to_remove }}"> |
| 405 | + <facet-remove> |
| 406 | + <a href="{{ value.url_to_remove }}" class="active-facets__button active-facets__button--light"> |
388 | 407 | <span class="active-facets__button-inner button button--tertiary">
|
389 |
| - {%- if filter.min_value.value -%}{{ filter.min_value.value | money }}{%- else -%}{{ 0 | money }}{%- endif -%}-{%- if filter.max_value.value -%}{{ filter.max_value.value | money }}{%- else -%}{{ filter.range_max | money }}{%- endif -%} |
| 408 | + {{ value.label | escape }} |
390 | 409 | {% render 'icon-close-small' %}
|
391 | 410 | </span>
|
392 | 411 | </a>
|
| 412 | + </facet-remove> |
| 413 | + {%- endfor -%} |
| 414 | + |
| 415 | + {% if filter.type == "price_range" %} |
| 416 | + {%- if filter.min_value.value != nil or filter.max_value.value != nil -%} |
| 417 | + <facet-remove> |
| 418 | + <a href="{{ filter.url_to_remove }}" class="active-facets__button active-facets__button--light"> |
| 419 | + <span class="active-facets__button-inner button button--tertiary"> |
| 420 | + {%- if filter.min_value.value -%}{{ filter.min_value.value | money }}{%- else -%}{{ 0 | money }}{%- endif -%}-{%- if filter.max_value.value -%}{{ filter.max_value.value | money }}{%- else -%}{{ filter.range_max | money }}{%- endif -%} |
| 421 | + {% render 'icon-close-small' %} |
| 422 | + </span> |
| 423 | + </a> |
| 424 | + </facet-remove> |
393 | 425 | {%- endif -%}
|
394 | 426 | {% endif %}
|
395 | 427 | {%- endfor -%}
|
|
0 commit comments