Skip to content

Commit

Permalink
lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
webjsavella committed Dec 16, 2024
1 parent aecaee7 commit a5c0fd8
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions eds/blocks/local-navigation/local-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ function navigationTitle(value, block) {
}

function listenSubNav(subNavItems) {
subNavItems.addEventListener('click', () => {
subNavItems.addEventListener('click', () => {
if (subNavItems.getAttribute('aria-expanded') === 'false') {
let order = subNavItems.getAttribute('attr-order');
const order = subNavItems.getAttribute('attr-order');
const allSubNavBtn = document.querySelectorAll('.subnav-btn');
subNavItems.setAttribute('aria-expanded', 'true');
subNavItems.nextElementSibling.setAttribute('aria-hidden', 'false');
let allSubNavBtn = document.querySelectorAll('.subnav-btn');
allSubNavBtn.forEach((btn) => {
if (btn.getAttribute('attr-order') !== order) {
btn.setAttribute('aria-expanded', 'false');
Expand All @@ -49,7 +49,6 @@ function listenSubNav(subNavItems) {
} else {
subNavItems.setAttribute('aria-expanded', 'false');
subNavItems.nextElementSibling.setAttribute('aria-hidden', 'true');
console.log('collapsed subnavItems', subNavItems);
}
});
}
Expand All @@ -72,9 +71,14 @@ function appendPageTitle(pgObj, block, i) {
aHref.setAttribute('aria-current', 'true');
}
if (pgObj.subnavItems) {
let subNavItems = domEl('button', { class: 'subnav-btn', 'aria-expanded': 'false', 'aria-controls': 'subnav', 'attr-order': i });
let subNav = domEl('div', { class: 'subnav', id: 'subnav', 'aria-hidden': 'true' });
let subNavUL = domEl('ul', { class: 'subnav-ul' });
const subNavItems = domEl('button', {

Check failure on line 74 in eds/blocks/local-navigation/local-navigation.js

View workflow job for this annotation

GitHub Actions / build

Trailing spaces not allowed
class: 'subnav-btn',

Check failure on line 75 in eds/blocks/local-navigation/local-navigation.js

View workflow job for this annotation

GitHub Actions / build

Trailing spaces not allowed
'aria-expanded': 'false',

Check failure on line 76 in eds/blocks/local-navigation/local-navigation.js

View workflow job for this annotation

GitHub Actions / build

Trailing spaces not allowed
'aria-controls': 'subnav',

Check failure on line 77 in eds/blocks/local-navigation/local-navigation.js

View workflow job for this annotation

GitHub Actions / build

Trailing spaces not allowed
'attr-order': i

Check failure on line 78 in eds/blocks/local-navigation/local-navigation.js

View workflow job for this annotation

GitHub Actions / build

Trailing spaces not allowed

Check failure on line 78 in eds/blocks/local-navigation/local-navigation.js

View workflow job for this annotation

GitHub Actions / build

Missing trailing comma
});
const subNav = domEl('div', { class: 'subnav', id: 'subnav', 'aria-hidden': 'true' });
const subNavUL = domEl('ul', { class: 'subnav-ul' });
li.appendChild(subNavItems);
subNavItems.innerHTML = pgObj.pageTitle;
listenSubNav(subNavItems);
Expand Down Expand Up @@ -209,8 +213,7 @@ function resetDropdown(block) {
window.addEventListener('resize', () => {
mobileBtn.setAttribute('icon', 'caret-down');
mobileMenu.setAttribute('aria-expanded', 'false');
}, 500)

}, 500);
}

/**
Expand All @@ -226,7 +229,6 @@ export default async function decorate(block) {
await fetch(requestURL)
.then((response) => response.json())
.then((data) => {
console.log('local navigation data');
initNavWrapper(block);
parseXML(data, block);
docAuthPageTitle(block);
Expand Down

0 comments on commit a5c0fd8

Please sign in to comment.