]> _ Git - fluidbook-html5.git/commitdiff
fix #2816 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 9 Jul 2019 14:29:52 +0000 (16:29 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 9 Jul 2019 14:29:52 +0000 (16:29 +0200)
js/libs/fluidbook/fluidbook.privacy.js

index 1072de0bc231a613796a2985343a5a4a7d51d2c3..2af33eb4376945c224f2444b0c38de7eae023826 100644 (file)
@@ -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('<div id="cookieConsent"><a href="#" class="close"></a><p>' + this.fluidbook.datas.cookieConsentMessage + '</p></div>');
         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;
         });