Default the cookie banner to be hidden

It should only be shown if JS is available and the
cookieMessage JS finds consent has not been set.
This commit is contained in:
Tom Byers
2020-01-14 12:11:40 +00:00
parent b6e37a6ac8
commit c18cb1e984
4 changed files with 11 additions and 23 deletions

View File

@@ -51,15 +51,10 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
// Show the cookie banner if not in the cookie settings page
if (!this.isInCookiesPage()) {
var hasCookiesPolicy = window.GOVUK.cookie('cookies_policy');
var shouldHaveCookieMessage = (this.$module && !hasCookiesPolicy);
if (shouldHaveCookieMessage) {
if (this.$module && !hasCookiesPolicy) {
this.$module.style.display = 'block';
} else {
this.$module.style.display = 'none';
}
} else {
this.$module.style.display = 'none';
}
};