Skip to content

Commit

Permalink
fixes to top border when no switcher
Browse files Browse the repository at this point in the history
  • Loading branch information
GrabowskiM committed Oct 25, 2023
1 parent 1ba6723 commit 21622a9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@
const prevMainContentTab = doc.querySelector(`[data-id="${prevHashId}"]`);
const currMainContentTab = doc.querySelector(`[data-id="${currHashId}"]`);

prevMainContentTab.classList.toggle('ibexa-anchor-navigation__section-group--active', false);
currMainContentTab.classList.toggle('ibexa-anchor-navigation__section-group--active', true);
prevMainContentTab?.classList.toggle('ibexa-anchor-navigation__section-group--active', false);
currMainContentTab?.classList.toggle('ibexa-anchor-navigation__section-group--active', true);

initFitSection();
});
Expand Down
6 changes: 6 additions & 0 deletions src/bundle/Resources/public/scss/_anchor-navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@
&--active {
display: block;
}

&--no-border {
border: 0;
margin-top: 0;
padding-top: 0;
}
}

&__sections-item-btn {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="ibexa-anchor-navigation-menu__body">
{% block navigation_menu_body %}
{% if items|default([])|length > 1 %}
<ul class="ibexa-anchor-navigation-menu__sections ibexa-anchor-navigation-menu__sections--active">
<ul class="ibexa-anchor-navigation-menu__sections ibexa-anchor-navigation-menu__sections--active ibexa-anchor-navigation-menu__sections--no-border">
{% for item in items %}
{% set item_label = item is iterable ? item.label : item %}
{% set sanitized_item = item is iterable and item.target_id is defined ? item.target_id : item_label|slug %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@
{% for secondMenuItem in item.children %}
{% if secondMenuItem.children|length > 1 %}
{% set listAttributes = {
'class': 'tab-pane ibexa-anchor-navigation-menu__sections' ~ (loop.first ? ' ibexa-anchor-navigation-menu__sections--active active' : ''),
'class': 'tab-pane ibexa-anchor-navigation-menu__sections'
~ (loop.first ? ' ibexa-anchor-navigation-menu__sections--active active' : '')
~ (item.count() == 1 ? ' ibexa-anchor-navigation-menu__sections--no-border' : ''),
'id': secondMenuItem.getAttribute('data-target-id'),
'role': 'tabpanel'
} %}
Expand All @@ -178,7 +180,9 @@
{% set tagElement = 'div' %}
{% set extraElements %}{% endset %}

{{ block('anchor_menu_list') -}}
{% with { item: secondMenuItem } %}
{{ block('anchor_menu_list') -}}
{% endwith %}
{% endif %}
{% endfor %}
</div>
Expand Down

0 comments on commit 21622a9

Please sign in to comment.