mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-02 04:20:34 -04:00
Import / require all code for the govuk frontend button
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
// For example, `export { Frontend }` will assign `Frontend` to `window.Frontend`
|
||||
import Header from 'govuk-frontend/components/header/header';
|
||||
import Details from 'govuk-frontend/components/details/details';
|
||||
import Button from 'govuk-frontend/components/button/button';
|
||||
|
||||
/**
|
||||
* TODO: Ideally this would be a NodeList.prototype.forEach polyfill
|
||||
@@ -33,6 +34,9 @@ function initAll (options) {
|
||||
// Defaults to the entire document if nothing is set.
|
||||
var scope = typeof options.scope !== 'undefined' ? options.scope : document
|
||||
|
||||
// Find all buttons with [role=button] on the scope to enhance.
|
||||
new Button(scope).init()
|
||||
|
||||
// Find all global details elements to enhance.
|
||||
var $details = scope.querySelectorAll('details')
|
||||
nodeListForEach($details, function ($detail) {
|
||||
@@ -48,6 +52,7 @@ function initAll (options) {
|
||||
var Frontend = {
|
||||
"Header": Header,
|
||||
"Details": Details,
|
||||
"Button": Button,
|
||||
"initAll": initAll
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,8 @@ const copy = {
|
||||
'header',
|
||||
'footer',
|
||||
'back-link',
|
||||
'details'
|
||||
'details',
|
||||
'button'
|
||||
];
|
||||
let done = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user