mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-06 03:13:42 -05:00
We have been clearing all the Google Analytics cookies on each page request. It is now possible for a user to consent to having Google Analytics cookies so this should have been checking for that before deleting them. This makes that change, with tests for those scenarios.
23 lines
631 B
JavaScript
23 lines
631 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').eq(0).parent('label').next('input').trigger('focus'));
|
|
|
|
$(() => $('.banner-dangerous').eq(0).trigger('focus'));
|