diff --git a/snippets/legacy-banner.conf b/snippets/legacy-banner.conf index 3a8f04f..104b5ab 100644 --- a/snippets/legacy-banner.conf +++ b/snippets/legacy-banner.conf @@ -11,6 +11,7 @@ set $legacy " z-index: 16777271; cursor: pointer; text-align: center; + display: none; } #legacywarnoverlay p { padding: 10px; diff --git a/snippets/legacy-js.conf b/snippets/legacy-js.conf index dff0027..8448e82 100644 --- a/snippets/legacy-js.conf +++ b/snippets/legacy-js.conf @@ -6,13 +6,15 @@ function legacywarnon() { function legacywarnoff() { document.getElementById('legacywarnoverlay').style.display = 'none'; - document.cookie = 'legacywarn=true; max-age=60*60*24 ; path=/'; + document.cookie = 'legacywarn=true; max-age=86400 ; path=/'; } document.addEventListener('DOMContentLoaded', function(){ document.getElementById('legacywarnoverlay').onclick = legacywarnoff; - if (document.cookie.indexOf('legacywarn=') > -1) { - document.getElementById('legacywarnoverlay').style.display = 'none'; - console.log('Hide Legacy IP warn'); - } - });"; + if (document.cookie.indexOf('legacywarn=') > -1) { + document.getElementById('legacywarnoverlay').style.display = 'none'; + console.log('Hide Legacy IP warn'); + } else { + legacywarnon(); + } +});"; }