Skip to content

Commit 480addb

Browse files
committed
fixes to top border when no switcher
1 parent 23190f3 commit 480addb

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

src/bundle/Resources/public/js/scripts/admin.anchor.navigation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@
134134
const prevMainContentTab = doc.querySelector(`[data-id="${prevHashId}"]`);
135135
const currMainContentTab = doc.querySelector(`[data-id="${currHashId}"]`);
136136

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

140140
initFitSection();
141141
});

src/bundle/Resources/public/scss/_anchor-navigation.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@
8282
&--active {
8383
display: block;
8484
}
85+
86+
&--no-border {
87+
border: 0;
88+
margin-top: 0;
89+
padding-top: 0;
90+
}
8591
}
8692

8793
&__sections-item-btn {

src/bundle/Resources/views/themes/admin/ui/anchor_navigation_menu.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<div class="ibexa-anchor-navigation-menu__body">
1919
{% block navigation_menu_body %}
2020
{% if items|default([])|length > 1 %}
21-
<ul class="ibexa-anchor-navigation-menu__sections ibexa-anchor-navigation-menu__sections--active">
21+
<ul class="ibexa-anchor-navigation-menu__sections ibexa-anchor-navigation-menu__sections--active ibexa-anchor-navigation-menu__sections--no-border">
2222
{% for item in items %}
2323
{% set item_label = item is iterable ? item.label : item %}
2424
{% set sanitized_item = item is iterable and item.target_id is defined ? item.target_id : item_label|slug %}

src/bundle/Resources/views/themes/admin/ui/menu/anchor_menu.html.twig

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@
168168
{% for secondMenuItem in item.children %}
169169
{% if secondMenuItem.children|length > 1 %}
170170
{% set listAttributes = {
171-
'class': 'tab-pane ibexa-anchor-navigation-menu__sections' ~ (loop.first ? ' ibexa-anchor-navigation-menu__sections--active active' : ''),
171+
'class': 'tab-pane ibexa-anchor-navigation-menu__sections'
172+
~ (loop.first ? ' ibexa-anchor-navigation-menu__sections--active active' : '')
173+
~ (item.count() == 1 ? ' ibexa-anchor-navigation-menu__sections--no-border' : ''),
172174
'id': secondMenuItem.getAttribute('data-target-id'),
173175
'role': 'tabpanel'
174176
} %}
@@ -178,7 +180,9 @@
178180
{% set tagElement = 'div' %}
179181
{% set extraElements %}{% endset %}
180182

181-
{{ block('anchor_menu_list') -}}
183+
{% with { item: secondMenuItem } %}
184+
{{ block('anchor_menu_list') -}}
185+
{% endwith %}
182186
{% endif %}
183187
{% endfor %}
184188
</div>

0 commit comments

Comments
 (0)