Skip to content

Commit

Permalink
small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tischsoic committed Apr 11, 2022
1 parent 305429d commit 0ce0213
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/bundle/Resources/public/js/scripts/adaptive.filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const adaptiveFilters = doc.querySelectorAll('.ibexa-adaptive-filters');
const initializeAdaptiveFilters = (adaptiveFilter) => {
const adaptiveItemsContainer = adaptiveFilter.querySelector('.ibexa-adaptive-filters__items');
const adaptiveItemsCollapsibleContainer = adaptiveFilter.querySelector('.ibexa-adaptive-filters__hidden');
const adaptiveItemsCollapsibleContainer = adaptiveFilter.querySelector('.ibexa-adaptive-filters__collapsible');
const actionsContainer = adaptiveFilter.querySelector('.ibexa-adaptive-filters__actions');
const toggleBtn = adaptiveFilter.querySelector('.ibexa-adaptive-filters__toggler');
const collapse = global.bootstrap.Collapse.getOrCreateInstance(adaptiveItemsCollapsibleContainer, {
Expand Down
4 changes: 2 additions & 2 deletions src/bundle/Resources/public/scss/_adaptive-filters.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
margin: calculateRem(-33px) calculateRem(-33px) calculateRem(24px) calculateRem(-33px);
}

&__main {
&__visible {
display: flex;
align-items: flex-end;
width: 100%;
Expand Down Expand Up @@ -76,7 +76,7 @@
overflow: hidden;
}

&__hidden {
&__collapsible {
display: flex;
padding: calculateRem(8px) 0 calculateRem(16px);
border-top: calculateRem(1px) solid $ibexa-color-light;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% import "@ibexadesign/ui/component/macros.html.twig" as html %}

{% trans_default_domain 'ibexa_adaptive_filters' %}
{% trans_default_domain 'adaptive_filters' %}

{% set attr = attr|default({})|merge({
class: ('ibexa-adaptive-filters '
Expand All @@ -15,7 +15,7 @@
{% set collapse_id = collapse_id|default('ibexa-adaptive-filters-collapse-' ~ random()) %}

{{ form_start(form, { attr: attr|merge(attr_form)}) }}
<div class="ibexa-adaptive-filters__main">
<div class="ibexa-adaptive-filters__visible">
<div class="ibexa-adaptive-filters__static-left">
{% block static_left %}
<div class="form-group">
Expand All @@ -25,13 +25,15 @@
{% endblock %}
</div>
<div class="ibexa-adaptive-filters__items ibexa-adaptive-filters__items--empty ibexa-adaptive-items">
{% block collapsible_items %}
{% for item in collapsible_items %}
{% include '@ibexadesign/ui/component/adaptive_filters/adaptive_filters_item.html.twig' with {
content: item,
} %}
{% endfor %}
{% endblock %}
{% if not no_collapsible_items|default(false) %}
{% block collapsible_items %}
{% for item in collapsible_items %}
{% include '@ibexadesign/ui/component/adaptive_filters/adaptive_filters_item.html.twig' with {
content: item,
} %}
{% endfor %}
{% endblock %}
{% endif %}
<div class="ibexa-adaptive-filters__actions ibexa-adaptive-items__item ibexa-adaptive-items__item--force-show">
{% block actions %}
<button
Expand Down Expand Up @@ -83,5 +85,5 @@
</div>
</div>
</div>
<div class="ibexa-adaptive-filters__hidden collapse" id="{{ collapse_id }}"></div>
<div class="ibexa-adaptive-filters__collapsible collapse" id="{{ collapse_id }}"></div>
{{ form_end(form) }}

0 comments on commit 0ce0213

Please sign in to comment.