mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-09 02:44:10 -04:00
20 lines
629 B
JavaScript
20 lines
629 B
JavaScript
|
|
import Header from 'govuk-frontend/components/header/header';
|
||
|
|
|
||
|
|
function initAll (options) {
|
||
|
|
// Set the options to an empty object by default if no options are passed.
|
||
|
|
options = typeof options !== 'undefined' ? options : {}
|
||
|
|
|
||
|
|
// Allow the user to initialise GOV.UK Frontend in only certain sections of the page
|
||
|
|
// Defaults to the entire document if nothing is set.
|
||
|
|
var scope = typeof options.scope !== 'undefined' ? options.scope : document
|
||
|
|
|
||
|
|
// Find first header module to enhance.
|
||
|
|
var $toggleButton = scope.querySelector('[data-module="header"]')
|
||
|
|
new Header($toggleButton).init()
|
||
|
|
}
|
||
|
|
|
||
|
|
export {
|
||
|
|
Header,
|
||
|
|
initAll
|
||
|
|
}
|