Skip to content

Commit

Permalink
fix(shs-5963): fixes in main-menu/megamenu js
Browse files Browse the repository at this point in the history
  • Loading branch information
cienvaras committed Dec 4, 2024
1 parent 2be0832 commit f5dc114
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
9 changes: 5 additions & 4 deletions docroot/themes/humsci/humsci_basic/humsci_basic.libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ main-content-fallback:

main-menu:
js:
dist/js/main-menu-toggle.js: {}
dist/js/main-menu-nested-toggler.js: {}
dist/js/collapse-main-menu.js: {}
dist/js/mega-menu.js: {}
dist/js/main-menu.js: {}

megamenu:
js:
dist/js/megamenu.js: {}

page-scroll-animations:
js:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import './main-menu-toggle';
import './main-menu-nested-toggler';
import './collapse-main-menu';
import './secondary-toggler';
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
*/
#}

{{ attach_library('humsci_basic/main-menu') }}

{% if use_hs_megamenu %}
{{ attach_library('humsci_basic/megamenu') }}

{# Twig megamenu attributes #}
{% set attributes = attributes.addClass(['megamenu', 'js-megamenu']) %}
{% set attributes = attributes.setAttribute('aria-label', 'main menu') %}
{% include "@humsci_basic/menus-twig/secondary-menu.twig" %}
{% else %}
{{ attach_library('humsci_basic/main-menu') }}

{# Legacy Drupal menu #}
{% set attributes = attributes.addClass(['hb-main-nav', 'su-main-nav', 'hb-main-nav--is-still-loading']) %}
{% set attributes = attributes.setAttribute('aria-label', 'main menu') %}
Expand Down
4 changes: 1 addition & 3 deletions docroot/themes/humsci/humsci_basic/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ const shared = {
'main-content-fallback': 'shared/main-content-fallback/main-content-fallback.js',
'video-with-caption': 'shared/media/video-with-caption.js',
megamenu: 'shared/megamenu/index.js',
'main-menu-toggle': 'shared/navigation/main-menu-toggle.js',
'main-menu-nested-toggler': 'shared/navigation/main-menu-nested-toggler.js',
'collapse-main-menu': 'shared/navigation/collapse-main-menu.js',
'main-menu': 'shared/navigation/main-menu-index.js',
'secondary-toggler': 'shared/navigation/secondary-toggler.js',
colorbox: 'shared/photo-album/colorbox.js',
'prefered-reduced-motion': 'shared/prefered-reduced-motion/prefered-reduced-motion.js',
Expand Down

0 comments on commit f5dc114

Please sign in to comment.