mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-06 11:23:48 -05:00
The cookie_message block was part of GOV.UK template but is not included in the GOV.UK Frontend template. This adds it back in along with JS to set the cookies from GOV.UK template and styles, taken from the Design System's website (which I assume has the right colour contrast).
17 lines
466 B
JavaScript
17 lines
466 B
JavaScript
(function () {
|
|
"use strict";
|
|
|
|
var root = this;
|
|
if(typeof root.GOVUK === 'undefined') { root.GOVUK = {}; }
|
|
|
|
GOVUK.addCookieMessage = function () {
|
|
var message = document.getElementById('global-cookie-message'),
|
|
hasCookieMessage = (message && GOVUK.cookie('seen_cookie_message') === null);
|
|
|
|
if (hasCookieMessage) {
|
|
message.style.display = 'block';
|
|
GOVUK.cookie('seen_cookie_message', 'yes', { days: 28 });
|
|
}
|
|
};
|
|
}).call(this);
|