Skip to content

Commit

Permalink
feat(shs-5693): add shared files in webpack and attached files in menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Mari Nez committed Nov 28, 2024
1 parent 70ab7c2 commit 4e02ad3
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 11 deletions.
6 changes: 0 additions & 6 deletions docroot/themes/humsci/humsci_basic/humsci_basic.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,3 @@ libraries-override:
css:
layout:
css/three-column-w-image.css: false

# we_megamenu/form.we-mega-menu-frontend:
# css:
# theme:
# assets/css/we_megamenu_backend.css: false
# assets/includes/bootstrap/css/bootstrap.min.css: false
12 changes: 11 additions & 1 deletion docroot/themes/humsci/humsci_basic/humsci_basic.libraries.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
mainmenu:
js:
dist/js/mainmenutoggle.js: {}
dist/js/mainmenunestedtoggler.js: {}
dist/js/collapsemainmenu.js: {}

search:
js:
src/js/shared/search/search-expand.js: {}
dist/js/search.js: {}

secondarymenu:
js:
dist/js/secondarytoggler.js: {}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
#}

{{ attach_library('humsci_basic/mainmenu') }}

{% if use_hs_megamenu %}
{# Twig megamenu attributes #}
{% set attributes = attributes.addClass(['megamenu', 'js-megamenu']) %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
{# The main and only way it is used on the site now is to create secondary nav #}
{%- import "@humsci_basic/menus/macros/secondary-nav-menu.twig" as menus -%}

{{ attach_library('humsci_basic/secondarymenu') }}

{% apply spaceless %}
{% if items is iterable %}
{{ menus.secondary_nav_menu(items, 1, 'hb-secondary-nav') }}
Expand Down
20 changes: 20 additions & 0 deletions docroot/themes/humsci/humsci_basic/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,26 @@ const srcDir = path.resolve(__dirname, 'src/js/');
const shared = {
accordion: 'shared/accordion/accordion-toggle-all.js',
addtocal: 'shared/addtocal/addtocal.js',
pagescroll: 'shared/animation/page-scroll.js',
carouselslidesheight: 'shared/carousel-slides/carousel-slides-height.js',
editoria11y: 'shared/editoria11y/editoria11y.js',
equalheightgrid: 'shared/equal-height-grid/index.js',
linkedcards: 'shared/linked-cards/linked-cards.js',
maincontentfallback: 'shared/main-content-fallback/main-content-fallback.js',
videowithcaption: 'shared/media/video-with-caption.js',
megamenu: 'shared/megamenu/index.js',
mainmenutoggle: 'shared/navigation/main-menu-toggle.js',
mainmenunestedtoggler: 'shared/navigation/main-menu-nested-toggler.js',
collapsemainmenu: 'shared/navigation/collapse-main-menu.js',
secondarytoggler: 'shared/navigation/secondary-toggler.js',
colorbox: 'shared/photo-album/colorbox.js',
preferedreducedmotion: 'shared/prefered-reduced-motion/prefered-reduced-motion.js',
search: 'shared/search/search-expand.js',
tablescope: 'shared/tables/scope.js',
tablepattern: 'shared/tables/table-pattern.js',
tablewrap: 'shared/tables/wrap.js',
timeline: 'shared/timeline/expand-collapse-timeline.js',
verticaltabs: 'shared/vertical-tabs/vertical-tabs.js',
};

// Colorful and traditional theme specific JS files.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ base:
css:
theme:
css/humsci_colorful.css: {}
js:
js/index.js: {}
dependencies:
- core/modernizr

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ base:
css:
theme:
css/humsci_traditional.css: {}
js:
js/index.js: {}
dependencies:
- core/modernizr

Expand Down

0 comments on commit 4e02ad3

Please sign in to comment.