Files
notifications-admin/app/assets/javascripts/main.js
Tom Byers f46dba8948 Move code for deleting old cookies into banner JS
Removes the following cookies:
- seen_cookie_message (flags if banner was already
  shown)
- _gid (Google Analytics cookie)
- _ga (Google Analytics cookie)

These were set by default before so potentially
still around for some users.

The code for this now exists as a static method on
the cookieMessage module and is called when the JS
loads for the first time.
2020-01-03 17:28:33 +00:00

22 lines
556 B
JavaScript

window.GOVUK.Frontend.initAll();
window.GOVUK.Modules.CookieBanner.clearOldCookies();
if (window.GOVUK.hasConsentFor('analytics')) {
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'));