2019-11-19 14:57:49 +00:00
|
|
|
window.GOVUK.Frontend.initAll();
|
2019-10-10 16:16:51 +01:00
|
|
|
|
2020-01-21 09:37:38 +00:00
|
|
|
var consentData = window.GOVUK.getConsentCookie();
|
|
|
|
|
window.GOVUK.Modules.CookieBanner.clearOldCookies(consentData);
|
2019-12-13 22:07:43 +00:00
|
|
|
|
2020-01-21 09:37:38 +00:00
|
|
|
if (window.GOVUK.hasConsentFor('analytics', consentData)) {
|
2020-01-02 14:26:57 +00:00
|
|
|
window.GOVUK.initAnalytics();
|
|
|
|
|
}
|
2019-12-13 22:07:43 +00:00
|
|
|
|
2016-09-28 17:47:40 +01:00
|
|
|
$(() => $("time.timeago").timeago());
|
|
|
|
|
|
2018-08-09 11:59:05 +01:00
|
|
|
var showHideContent = new GOVUK.ShowHideContent();
|
|
|
|
|
showHideContent.init();
|
|
|
|
|
|
2015-12-20 00:00:01 +00:00
|
|
|
$(() => GOVUK.modules.start());
|
2016-01-13 17:42:01 +00:00
|
|
|
|
2023-06-08 13:12:00 -04:00
|
|
|
$(() => $('.error-message, .usa-error-message').eq(0).parent('label').next('input').trigger('focus'));
|
2017-02-13 12:11:32 +00:00
|
|
|
|
2020-09-23 10:16:38 +01:00
|
|
|
$(() => $('.govuk-header__container').on('click', function() {
|
|
|
|
|
$(this).css('border-color', '#005ea5');
|
|
|
|
|
}));
|
2022-02-08 11:07:57 +00:00
|
|
|
|
2022-02-15 11:26:17 +00:00
|
|
|
// Applies our expanded focus style to the siblings of links when that link is wrapped in a heading.
|
|
|
|
|
//
|
|
|
|
|
// This will be possible in CSS in the future, using the :has pseudo-class. When :has is available
|
|
|
|
|
// in the browsers we support, this code can be replaced with a CSS-only solution.
|
2022-02-08 11:07:57 +00:00
|
|
|
$('.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');
|
|
|
|
|
}
|
|
|
|
|
});
|