diff --git a/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js b/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js index 8e58f265a0..b8de104034 100644 --- a/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +++ b/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js @@ -62,6 +62,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {}; CookieBanner.prototype.hideCookieMessage = function (event) { if (this.$module) { + this.$module.hidden = true this.$module.style.display = 'none' window.GOVUK.cookie('cookies_preferences_set', 'true', { days: 365 }) } @@ -97,8 +98,9 @@ window.GOVUK.Modules = window.GOVUK.Modules || {}; CookieBanner.prototype.showConfirmationMessage = function () { this.$cookieBannerMainContent = document.querySelector('.gem-c-cookie-banner__wrapper') - this.$cookieBannerMainContent.style.display = 'none' + this.$cookieBannerMainContent.hidden = true this.$module.cookieBannerConfirmationMessage.style.display = 'block' + this.$module.cookieBannerConfirmationMessage.hidden = false } CookieBanner.prototype.isInCookiesPage = function () { diff --git a/app/views/govuk_publishing_components/components/_cookie_banner.html.erb b/app/views/govuk_publishing_components/components/_cookie_banner.html.erb index e166f6c3c5..187f53351a 100644 --- a/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +++ b/app/views/govuk_publishing_components/components/_cookie_banner.html.erb @@ -72,7 +72,7 @@ -