Skip to content

Commit

Permalink
after cr
Browse files Browse the repository at this point in the history
  • Loading branch information
GrabowskiM authored and dew326 committed Aug 31, 2022
1 parent e3a4c88 commit 6829de6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
};
const getLastSection = (sectionGroup) => {
const sections = sectionGroup.querySelectorAll('.ibexa-anchor-navigation__section');

return sections ? [...sections].at(-1) : null;
};
const fitSections = () => {
Expand Down Expand Up @@ -145,7 +146,6 @@
previousFirstVisibleSection = firstVisibleSection;

const targetId = firstVisibleSection.dataset.id;

const secondaryMenuNode = doc.querySelector(
`.ibexa-anchor-navigation-menu__sections--active .ibexa-anchor-navigation-menu__sections-item-btn[data-target-id="${targetId}"]`,
);
Expand Down Expand Up @@ -179,11 +179,12 @@

const { id } = sectionGroup.dataset;
const hasGroupError = !!sectionGroup.querySelector('.is-invalid');
const correspodingMenuItem =
const correspondingMenuItem =
doc.querySelector(`.ibexa-anchor-navigation-menu__section-groups-item[data-target-id="${id}"]`) ??
doc.querySelector(`.ibexa-anchor-navigation-menu .ibexa-dropdown__item[data-value="${id}"]`);
const errorIconNode = correspodingMenuItem.querySelector('.ibexa-anchor-navigation-menu__item-error');
const errorIconNode = correspondingMenuItem.querySelector('.ibexa-anchor-navigation-menu__item-error');
const dropdownWidget = doc.querySelector('.ibexa-anchor-navigation-menu .ibexa-dropdown');

errorIconNode.classList.toggle('ibexa-anchor-navigation-menu__item-error--hidden', !hasGroupError);

if (dropdownWidget) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(function () {
// depraacted, will be removed in 5.0
// code that was in this file was mostly moved and unified with admin.anchor.navigation.js
console.warn('admin.anchor.sections.navigation.js has been depracted in favor for admin.anchor.navigation.js');
})();

0 comments on commit 6829de6

Please sign in to comment.