forked from timber/starter-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6960088
commit 3c949f5
Showing
1 changed file
with
31 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,35 @@ | ||
// IMPORTS GO HERE | ||
import accessibleMenu from "../../views/components/header/accessible-menu"; | ||
import navigation from "../../views/components/header/navigation"; | ||
import skipLinkFocusFix from "./components/skip-link-focus-fix"; | ||
/* IMPORTS GO HERE */ | ||
import accessibleMenu from "../../views/organisms/header/display/accessible-menu"; | ||
import mobileMenu from "../../views/organisms/header/display/mobile-menu"; | ||
import skipLinkFocusFix from "../../views/organisms/header/display/skip-link-focus-fix"; | ||
|
||
async function init () { | ||
/* Load JS for blocks only if they exist on the page */ | ||
// https://parceljs.org/features/code-splitting/ | ||
// Accordion | ||
const accordionsList = document.querySelector(".accordion"); | ||
if (accordionsList) { | ||
const accordionsJS = await import('../../views/blocks/accordion/accordion'); | ||
accordionsJS.render(); | ||
} | ||
async function init() { | ||
/* Load JS for blocks only if they exist on the page */ | ||
/* https://parceljs.org/features/code-splitting/ */ | ||
/* Accordion */ | ||
const accordionsList = document.querySelector(".accordion"); | ||
if (accordionsList) { | ||
const accordionsJS = await import( '../../views/organisms/blocks/accordion/display/accordion' ); | ||
accordionsJS.render(); | ||
} | ||
/* People Cards */ | ||
const peopleCardsGrid = document.querySelector(".people-cards"); | ||
if (peopleCardsGrid) { | ||
const peopleCardsJS = await import('../../views/organisms/blocks/people-cards/display/people-cards.js'); | ||
peopleCardsJS.render(); | ||
} | ||
/* Video Element */ | ||
const videoElement = document.querySelector('.video-container'); | ||
if (videoElement) { | ||
const videoJS = await import("../../views/organisms/blocks/banner/display/banner.js"); | ||
videoJS.render(); | ||
} | ||
|
||
// Global Components | ||
skipLinkFocusFix(); | ||
accessibleMenu(); | ||
navigation(); | ||
/* Global Components */ | ||
skipLinkFocusFix(); | ||
accessibleMenu(); | ||
mobileMenu(); | ||
} | ||
|
||
// Initialize Site Scripts | ||
init(); | ||
/* Initialize Site Scripts */ | ||
init(); |