From 3775bf1e9979701c0e95e15faa02ff9b65b82f3f Mon Sep 17 00:00:00 2001 From: Silver Kuusik Date: Sun, 8 Jul 2018 21:00:54 +0200 Subject: [PATCH] add cookie status on initialise listener --- assets/js/cookie.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/assets/js/cookie.js b/assets/js/cookie.js index 63cb145..8c3aaac 100644 --- a/assets/js/cookie.js +++ b/assets/js/cookie.js @@ -15,11 +15,17 @@ window.addEventListener("load", function() { "background": "#ffd500ff" } }, - onStatusChange: function(status, chosenBefore) { - // Allow cookies + onInitialise: function (status) { + // When cookies are allowed if (status == 'allow') { cookiesEnabled = true; - // Disable cookies + } + }, + onStatusChange: function(status, chosenBefore) { + // When cookies are allowed + if (status == 'allow') { + cookiesEnabled = true; + // When cookies are disabled } else { cookiesEnabled = false }