mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-17 11:46:30 -04:00
Includes: - JS to add a class to the heading when the link is focused - CSS to apply the enlarged focus style via a selector which uses that class - changes to the partial to hook in the JS to track focus on links and to tell the updateContent JS to persist the classes added between updates to the HTML
36 lines
1007 B
JavaScript
36 lines
1007 B
JavaScript
window.GOVUK.Frontend.initAll();
|
|
|
|
var consentData = window.GOVUK.getConsentCookie();
|
|
window.GOVUK.Modules.CookieBanner.clearOldCookies(consentData);
|
|
|
|
if (window.GOVUK.hasConsentFor('analytics', consentData)) {
|
|
window.GOVUK.initAnalytics();
|
|
}
|
|
|
|
$(() => $("time.timeago").timeago());
|
|
|
|
$(() => GOVUK.stickAtTopWhenScrolling.init());
|
|
$(() => GOVUK.stickAtBottomWhenScrolling.init());
|
|
|
|
var showHideContent = new GOVUK.ShowHideContent();
|
|
showHideContent.init();
|
|
|
|
$(() => GOVUK.modules.start());
|
|
|
|
$(() => $('.error-message, .govuk-error-message').eq(0).parent('label').next('input').trigger('focus'));
|
|
|
|
$(() => $('.banner-dangerous').eq(0).trigger('focus'));
|
|
|
|
$(() => $('.govuk-header__container').on('click', function() {
|
|
$(this).css('border-color', '#005ea5');
|
|
}));
|
|
|
|
$('.js-mark-focus-on-parent').on('focus blur', '*', e => {
|
|
$target = $(e.target);
|
|
if (e.type === 'focusin') {
|
|
$target.parent().addClass('js-child-has-focus');
|
|
} else {
|
|
$target.parent().removeClass('js-child-has-focus');
|
|
}
|
|
});
|