forked from marva/sumorobot-web
add opt-in and status change listener
This commit is contained in:
parent
702cfab6bc
commit
b03e7374a5
@ -1,5 +1,12 @@
|
||||
var cookiesEnabled = false;
|
||||
|
||||
window.addEventListener("load", function() {
|
||||
window.cookieconsent.initialise({
|
||||
"type": "opt-in",
|
||||
"position": "bottom-right",
|
||||
content: {
|
||||
message: 'Please allow cookies to enable all features of this website.'
|
||||
},
|
||||
"palette": {
|
||||
"popup": {
|
||||
"background": "#242943ff"
|
||||
@ -7,6 +14,15 @@ window.addEventListener("load", function() {
|
||||
"button": {
|
||||
"background": "#ffd500ff"
|
||||
}
|
||||
},
|
||||
onStatusChange: function(status, chosenBefore) {
|
||||
// Allow cookies
|
||||
if (status == 'allow') {
|
||||
cookiesEnabled = true;
|
||||
// Disable cookies
|
||||
} else {
|
||||
cookiesEnabled = false
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user