Skip to content
Snippets Groups Projects
Unverified Commit ec979ddc authored by Alexis BENOIT's avatar Alexis BENOIT Committed by GitHub
Browse files

Correction du script de la navigation principale (#477)

parent 0f1f3ec9
No related branches found
No related tags found
No related merge requests found
......@@ -13,9 +13,7 @@ class MainMenu {
this.element = document.querySelector(selector);
this.menu = this.element.querySelector('.menu');
this.mainButton = this.element.querySelector('button.header-button');
if (!this.mainButton) {
return;
}
this.dropdownsButtons = this.element.querySelectorAll('.has-children [role="button"]');
this.state = {
......@@ -39,9 +37,11 @@ class MainMenu {
}
});
this.mainButton.addEventListener('click', () => {
this.toggleMainMenu();
});
if (this.mainButton) {
this.mainButton.addEventListener('click', () => {
this.toggleMainMenu();
});
}
this.dropdownsButtons.forEach((button) => {
a11yClick(button, (event) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment