mirror of
https://github.com/GSA/notifications-admin.git
synced 2025-12-16 01:53:56 -05:00
17 lines
646 B
JavaScript
17 lines
646 B
JavaScript
(function (window) {
|
|
"use strict";
|
|
|
|
/*
|
|
This module is intended to be used to show and hide an error banner based on a javascript trigger. You should make
|
|
sure the banner has an appropriate aria-live attribute, and a tabindex of -1 so that screenreaders and keyboard users
|
|
are alerted to the change respectively.
|
|
|
|
This may behave in unexpected ways if you have more than one element with the `banner-dangerous` class on your page.
|
|
*/
|
|
window.GOVUK.ErrorBanner = {
|
|
hideBanner: () => $('.banner-dangerous').addClass('display-none'),
|
|
showBanner: () => $('.banner-dangerous')
|
|
.removeClass('display-none')
|
|
};
|
|
})(window);
|