From f2ed186d32b58356a260e394eb63b981a277919a Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 9 Jul 2019 16:29:52 +0200 Subject: [PATCH] fix #2816 @0.25 --- js/libs/fluidbook/fluidbook.privacy.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.privacy.js b/js/libs/fluidbook/fluidbook.privacy.js index 1072de0b..2af33eb4 100644 --- a/js/libs/fluidbook/fluidbook.privacy.js +++ b/js/libs/fluidbook/fluidbook.privacy.js @@ -9,9 +9,10 @@ function FluidbookPrivacy(fluidbook) { } this.init(); } + FluidbookPrivacy.prototype = { init: function () { - if (localStorage.getItem(this.storageKey) == '1') { + if (localStorage.getItem(this.storageKey) === '1') { return; } @@ -21,6 +22,9 @@ FluidbookPrivacy.prototype = { }); }, displayCookieConsent: function () { + if($("#cookieConsent").length>0){ + return; + } var $this = this; $('body').append('

' + this.fluidbook.datas.cookieConsentMessage + '

'); if (this.fluidbook.datas.cookieConsentAutoclose > 0) { @@ -28,7 +32,7 @@ FluidbookPrivacy.prototype = { $this.close(); }, this.fluidbook.datas.cookieConsentAutoclose * 1000); } - $("#cookieConsent a.close").on('touchend click', function () { + $(document).on('touchend click', "#cookieConsent a.close", function () { $this.close(); return false; }); -- 2.39.5