Skip to content

Commit

Permalink
linting, update js spec
Browse files Browse the repository at this point in the history
  • Loading branch information
martyn-w committed May 16, 2024
1 parent 9e3cf4e commit 1cac3ad
Show file tree
Hide file tree
Showing 2 changed files with 202 additions and 288 deletions.
19 changes: 14 additions & 5 deletions app/webpacker/controllers/navigation_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export default class extends Controller {

const correspondingItem = this.getTargetItem(item.dataset.correspondingId);
const childMenu = this.getTargetItem(item.dataset.childMenuId);
const correspondingChildMenu = this.getTargetItem(item.dataset.correspondingChildMenuId);
const correspondingChildMenu = this.getTargetItem(
item.dataset.correspondingChildMenuId,
);
const toggleSecondaryNavigation = item.dataset.toggleSecondaryNavigation;

event.preventDefault();
Expand Down Expand Up @@ -62,8 +64,11 @@ export default class extends Controller {

const childMenu = this.getTargetItem(item.dataset.childMenuId);
const nextItem = childMenu.querySelector('li > .menu-link');
const correspondingChildMenu = this.getTargetItem(item.dataset.correspondingChildMenuId);
const correspondingNextItem = correspondingChildMenu.querySelector('li > .menu-link');
const correspondingChildMenu = this.getTargetItem(
item.dataset.correspondingChildMenuId,
);
const correspondingNextItem =
correspondingChildMenu.querySelector('li > .menu-link');

if (nextItem) {
nextItem.focus();
Expand Down Expand Up @@ -152,7 +157,9 @@ export default class extends Controller {
[].forEach.call(item.closest('ol').children, function (sibling) {
if (sibling !== item) {
if (self.toggleIconContracted(sibling)) {
const correspondingItem = self.getTargetItem(sibling.dataset.correspondingId);
const correspondingItem = self.getTargetItem(
sibling.dataset.correspondingId,
);

self.toggleIconContracted(correspondingItem);
self.contractAndHideChildItem(sibling);
Expand All @@ -166,7 +173,9 @@ export default class extends Controller {
if (!item) return;

const childMenu = this.getTargetItem(item.dataset.childMenuId);
const correspondingChildMenu = this.getTargetItem(item.dataset.correspondingChildMenuId);
const correspondingChildMenu = this.getTargetItem(
item.dataset.correspondingChildMenuId,
);
this.contractAndHideChildMenu(childMenu);
this.contractAndHideChildMenu(correspondingChildMenu);
}
Expand Down
Loading

0 comments on commit 1cac3ad

Please sign in to comment.