Skip to content

Commit

Permalink
Hide items with hidden attribute instead of display style
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgds committed Feb 12, 2021
1 parent 7b2d261 commit 3f36902
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};

CookieBanner.prototype.hideCookieMessage = function (event) {
if (this.$module) {
this.$module.style.display = 'none'
this.$module.hidden = true
window.GOVUK.cookie('cookies_preferences_set', 'true', { days: 365 })
}

Expand Down Expand Up @@ -97,8 +97,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 () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
</div>
</div>

<div class="gem-c-cookie-banner__confirmation govuk-width-container" tabindex="-1">
<div class="gem-c-cookie-banner__confirmation govuk-width-container" tabindex="-1" hidden>
<p class="gem-c-cookie-banner__confirmation-message" role="alert"><%= confirmation_message %></p>
<button class="gem-c-cookie-banner__hide-button" data-hide-cookie-banner="true" data-module="track-click" data-track-category="cookieBanner" data-track-action="Hide cookie banner">Hide</button>
</div>
Expand Down

0 comments on commit 3f36902

Please sign in to comment.