diff --git a/src/bundle/Resources/public/js/scripts/admin.anchor.navigation.js b/src/bundle/Resources/public/js/scripts/admin.anchor.navigation.js index a6ab11598..aeef882c3 100644 --- a/src/bundle/Resources/public/js/scripts/admin.anchor.navigation.js +++ b/src/bundle/Resources/public/js/scripts/admin.anchor.navigation.js @@ -173,10 +173,22 @@ behavior: 'smooth', }); }; + const setEditContentClassForAnchorMenu = () => { + const editContentWrapper = doc.querySelector('.ibexa-edit-content-width-wrapper'); + + if (!editContentWrapper) { + return; + } + + if (getVisibleSections().length > 1) { + editContentWrapper.classList.add('ibexa-edit-content-width-wrapper--with-anchor-menu'); + } + }; attachMenuTabShowEvents(); attachMenuSectionsEvents(); initFitSection(); attachScrollContainerEvents(); + setEditContentClassForAnchorMenu(); ibexa.helpers.tooltips.parse(navigationMenu); })(window, window.document, window.ibexa); diff --git a/src/bundle/Resources/public/scss/_content-edit.scss b/src/bundle/Resources/public/scss/_content-edit.scss index a91bfaf81..e7348b725 100644 --- a/src/bundle/Resources/public/scss/_content-edit.scss +++ b/src/bundle/Resources/public/scss/_content-edit.scss @@ -5,7 +5,9 @@ @include edit-right-side-container; &-width-wrapper { - width: calc(100% - calculateRem(300px)); + &--with-anchor-menu { + width: calc(100% - calculateRem(224px)); + } } &__container {