Skip to content

Node.js based forum software built for the modern web

add body class when cookie consent warning is open

Andrew Rodriguese2ecbae06c59
diff --git a/public/src/app.js b/public/src/app.js
index 161539c675..f9f5f53ba5 100644
--- a/public/src/app.js
+++ b/public/src/app.js
@@ -692,6 +692,7 @@ app.cacheBuster = null;
app.parseAndTranslate('partials/cookie-consent', config.cookies, function (html) {
$(document.body).append(html);
+ $(document.body).addClass('cookie-consent-open');
var warningEl = $('.cookie-consent');
var dismissEl = warningEl.find('button');
@@ -699,6 +700,7 @@ app.cacheBuster = null;
// Save consent cookie and remove warning element
storage.setItem('cookieconsent', '1');
warningEl.remove();
+ $(document.body).removeClass('cookie-consent-open');
});
});
});