diff --git a/build/ouibounce.js b/build/ouibounce.js index 88de1e1..85b8718 100644 --- a/build/ouibounce.js +++ b/build/ouibounce.js @@ -45,10 +45,12 @@ return function ouiBounce(el, config) { callback(); } + var disableKeydown = false; function handleKeydown(e) { - if(checkCookieValue('viewedOuibounceModal', 'true') && !aggressive) return; + if (disableKeydown || checkCookieValue('viewedOuibounceModal', 'true') && !aggressive) return; else if(!e.metaKey || e.keyCode != 76) return; + disableKeydown = true; fire(); callback(); } diff --git a/build/ouibounce.min.js b/build/ouibounce.min.js index 1d298ba..6454f14 100644 --- a/build/ouibounce.min.js +++ b/build/ouibounce.min.js @@ -1 +1 @@ -!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t(require,exports,module):e.ouiBounce=t()}(this,function(){return function(e,t){function n(e,t){return"undefined"==typeof e?t:e}function i(e){var t=24*e*60*60*1e3,n=new Date;return n.setTime(n.getTime()+t),"; expires="+n.toGMTString()}function o(){p.addEventListener("mouseout",u),p.addEventListener("keydown",r)}function u(e){e.clientY>a||c("viewedOuibounceModal","true")&&!s||(d(),l())}function r(e){(!c("viewedOuibounceModal","true")||s)&&e.metaKey&&76==e.keyCode&&(d(),l())}function c(e,t){var n=document.cookie.split("; ").reduce(function(e,t){var n=t.split("=");return e[n[0]]=n[1],e},{});return n[e]===t}function d(){e.style.display="block",f()}function f(){document.cookie="viewedOuibounceModal=true"+v,p.removeEventListener("mouseout",u)}var t=t||{},s=t.aggressive||!1,a=n(t.sensitivity,20),m=n(t.timer,1e3),l=t.callback||function(){},v=i(t.cookieExpire)||"",p=document.getElementsByTagName("html")[0];return setTimeout(o,m),{fire:d,disable:f}}}); \ No newline at end of file +!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t(require,exports,module):e.ouiBounce=t()}(this,function(){return function(e,t){function n(e,t){return"undefined"==typeof e?t:e}function i(e){var t=24*e*60*60*1e3,n=new Date;return n.setTime(n.getTime()+t),"; expires="+n.toGMTString()}function o(){p.addEventListener("mouseout",u),p.addEventListener("keydown",r)}function u(e){e.clientY>a||c("viewedOuibounceModal","true")&&!s||(d(),l())}function r(e){y||c("viewedOuibounceModal","true")&&!s||e.metaKey&&76==e.keyCode&&(y=!0,d(),l())}function c(e,t){var n=document.cookie.split("; ").reduce(function(e,t){var n=t.split("=");return e[n[0]]=n[1],e},{});return n[e]===t}function d(){e.style.display="block",f()}function f(){document.cookie="viewedOuibounceModal=true"+v,p.removeEventListener("mouseout",u)}var t=t||{},s=t.aggressive||!1,a=n(t.sensitivity,20),m=n(t.timer,1e3),l=t.callback||function(){},v=i(t.cookieExpire)||"",p=document.getElementsByTagName("html")[0];setTimeout(o,m);var y=!1;return{fire:d,disable:f}}}); \ No newline at end of file