fix cookie notice
This commit is contained in:
parent
b2472e6881
commit
8aecbd15c5
5 changed files with 16 additions and 18 deletions
24
js/cookie.js
24
js/cookie.js
|
@ -1,7 +1,3 @@
|
|||
function acceptCookie(){
|
||||
document.cookie = "cookieMessageHide=1";
|
||||
checkHide();
|
||||
}
|
||||
|
||||
function getCookie(name){
|
||||
var nameEQ = name + "=";
|
||||
|
@ -14,11 +10,15 @@ function getCookie(name){
|
|||
return null
|
||||
}
|
||||
|
||||
function checkHide(){
|
||||
let cookieInfo = document.getElementsByClassName("cookieinfo")[0];
|
||||
if (getCookie("cookieMessageHide") === "1"){
|
||||
cookieInfo.style.display = "none";
|
||||
} else {
|
||||
cookieInfo.style.display = "block";
|
||||
}
|
||||
}
|
||||
let cookieInfo = document.querySelector(".cookieinfo");
|
||||
if (getCookie("cookieMessageHide") === "1"){
|
||||
cookieInfo.style.display = "none";
|
||||
} else {
|
||||
cookieInfo.style.display = "block";
|
||||
}
|
||||
|
||||
document.querySelector(".cookieinfo-close").onclick = function() {
|
||||
console.log("close");
|
||||
document.cookie = "cookieMessageHide=1";
|
||||
cookieInfo.style.display = "none";
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require("./burgerMenu");
|
||||
require("./cookie");
|
||||
require("./burgerMenu");
|
||||
require("./dialog");
|
||||
require("./error");
|
||||
require("./imgPreview");
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"compile": "concurrently \"yarn css\" \"yarn js\"",
|
||||
"css": "sass scss/:public/css --style=compressed --no-source-map",
|
||||
"js": "webpack --config ./webpack.conf.js",
|
||||
"watch": "concurrently \"sass --watch --style compressed scss/:public/css\" \"cd public && php -S locaLhost:1234\" \"webpack --config ./webpack.conf.js --mode development\""
|
||||
"watch": "concurrently \"sass --watch --style compressed scss/:public/css\" \"cd public && php -S locaLhost:1234\" \"webpack --config ./webpack.conf.js --mode development --watch\""
|
||||
},
|
||||
"devDependencies": {
|
||||
"@webpack-cli/init": "^1.1.3",
|
||||
|
|
|
@ -42,7 +42,7 @@ function getFooter(){
|
|||
</div>
|
||||
</footer>
|
||||
<div class="cookieinfo">
|
||||
<div class="cookieinfo-close" onclick="acceptCookie()">
|
||||
<div class="cookieinfo-close">
|
||||
✖
|
||||
</div>
|
||||
<span class="cookieinfo-text">
|
||||
|
@ -50,9 +50,6 @@ function getFooter(){
|
|||
</span>
|
||||
</div>
|
||||
<script src="/js/script.js"></script>
|
||||
<script>
|
||||
checkHide();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
EOF);
|
||||
|
|
|
@ -7,6 +7,7 @@ module.exports = {
|
|||
output: {
|
||||
path: path.resolve(__dirname, "public/js"),
|
||||
filename: "script.js",
|
||||
libraryTarget: 'window'
|
||||
},
|
||||
mode: "production"
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue