From 3d6ee63948779a9dfc536c65f17bca342a36c591 Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Sun, 26 Oct 2014 10:29:14 +0100 Subject: [PATCH] Fix bug on the "disable" method options --- build/ouibounce.js | 2 +- build/ouibounce.min.js | 2 +- source/ouibounce.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/ouibounce.js b/build/ouibounce.js index b80b8e6..040b169 100644 --- a/build/ouibounce.js +++ b/build/ouibounce.js @@ -117,7 +117,7 @@ return function ouibounce(el, config) { } if (typeof options.cookieName !== 'undefined') { - cookieName = 'viewedOuibounceModal'; + cookieName = options.cookieName; } document.cookie = cookieName + '=true' + cookieExpire + cookieDomain + sitewide; diff --git a/build/ouibounce.min.js b/build/ouibounce.min.js index 60e1792..d61a9a4 100644 --- a/build/ouibounce.min.js +++ b/build/ouibounce.min.js @@ -1 +1 @@ -!function(e,n){"function"==typeof define&&define.amd?define(n):"object"==typeof exports?module.exports=n(require,exports,module):e.ouibounce=n()}(this,function(){return function(e,n){function o(e,n){return"undefined"==typeof e?n:e}function i(e){var n=24*e*60*60*1e3,o=new Date;return o.setTime(o.getTime()+n),"; expires="+o.toUTCString()}function t(){L.addEventListener("mouseleave",u),L.addEventListener("mouseenter",r),L.addEventListener("keydown",c)}function u(e){e.clientY>v||d(w,"true")&&!l||(T=setTimeout(m,k))}function r(){T&&(clearTimeout(T),T=null)}function c(e){g||d(w,"true")&&!l||e.metaKey&&76===e.keyCode&&(g=!0,T=setTimeout(m,k))}function d(e,n){return a()[e]===n}function a(){for(var e=document.cookie.split("; "),n={},o=e.length-1;o>=0;o--){var i=e[o].split("=");n[i[0]]=i[1]}return n}function m(){f(),y()}function f(){e&&(e.style.display="block"),s()}function s(e){var e=e||{};"undefined"!=typeof e.cookieExpire&&(E=i(e.cookieExpire)),e.sitewide===!0&&(x=";path=/"),"undefined"!=typeof e.cookieDomain&&(b=";domain="+e.cookieDomain),"undefined"!=typeof e.cookieName&&(w="viewedOuibounceModal"),document.cookie=w+"=true"+E+b+x,L.removeEventListener("mouseleave",u),L.removeEventListener("mouseenter",r),L.removeEventListener("keydown",c)}var n=n||{},l=n.aggressive||!1,v=o(n.sensitivity,20),p=o(n.timer,1e3),k=o(n.delay,0),y=n.callback||function(){},E=i(n.cookieExpire)||"",b=n.cookieDomain?";domain="+n.cookieDomain:"",w=n.cookieName?n.cookieName:"viewedOuibounceModal",x=n.sitewide===!0?";path=/":"",T=null,L=document.documentElement;setTimeout(t,p);var g=!1;return{fire:f,disable:s}}}); \ No newline at end of file +!function(e,n){"function"==typeof define&&define.amd?define(n):"object"==typeof exports?module.exports=n(require,exports,module):e.ouibounce=n()}(this,function(){return function(e,n){function o(e,n){return"undefined"==typeof e?n:e}function t(e){var n=24*e*60*60*1e3,o=new Date;return o.setTime(o.getTime()+n),"; expires="+o.toUTCString()}function i(){L.addEventListener("mouseleave",u),L.addEventListener("mouseenter",r),L.addEventListener("keydown",c)}function u(e){e.clientY>v||d(T,"true")&&!l||(w=setTimeout(m,p))}function r(){w&&(clearTimeout(w),w=null)}function c(e){g||d(T,"true")&&!l||e.metaKey&&76===e.keyCode&&(g=!0,w=setTimeout(m,p))}function d(e,n){return a()[e]===n}function a(){for(var e=document.cookie.split("; "),n={},o=e.length-1;o>=0;o--){var t=e[o].split("=");n[t[0]]=t[1]}return n}function m(){f(),y()}function f(){e&&(e.style.display="block"),s()}function s(e){var e=e||{};"undefined"!=typeof e.cookieExpire&&(E=t(e.cookieExpire)),e.sitewide===!0&&(b=";path=/"),"undefined"!=typeof e.cookieDomain&&(x=";domain="+e.cookieDomain),"undefined"!=typeof e.cookieName&&(T=e.cookieName),document.cookie=T+"=true"+E+x+b,L.removeEventListener("mouseleave",u),L.removeEventListener("mouseenter",r),L.removeEventListener("keydown",c)}var n=n||{},l=n.aggressive||!1,v=o(n.sensitivity,20),k=o(n.timer,1e3),p=o(n.delay,0),y=n.callback||function(){},E=t(n.cookieExpire)||"",x=n.cookieDomain?";domain="+n.cookieDomain:"",T=n.cookieName?n.cookieName:"viewedOuibounceModal",b=n.sitewide===!0?";path=/":"",w=null,L=document.documentElement;setTimeout(i,k);var g=!1;return{fire:f,disable:s}}}); \ No newline at end of file diff --git a/source/ouibounce.js b/source/ouibounce.js index 4a0d732..02a4fb9 100644 --- a/source/ouibounce.js +++ b/source/ouibounce.js @@ -105,7 +105,7 @@ function ouibounce(el, config) { } if (typeof options.cookieName !== 'undefined') { - cookieName = 'viewedOuibounceModal'; + cookieName = options.cookieName; } document.cookie = cookieName + '=true' + cookieExpire + cookieDomain + sitewide;