From b93c5be7d23dcd183056ae4a48ead004b3616663 Mon Sep 17 00:00:00 2001 From: memboc Date: Sun, 14 May 2017 15:44:32 +0300 Subject: [PATCH] control the disable ouibounce through callback if callback return *false* cookie is not created. And after that we can disable popup only by pressing "No thanks" button, e.g. _ouibounce.disable({ cookieExpire: 7, sitewide: true }); --- source/ouibounce.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/ouibounce.js b/source/ouibounce.js index 1bb73dd..f3431fb 100644 --- a/source/ouibounce.js +++ b/source/ouibounce.js @@ -86,8 +86,9 @@ function ouibounce(el, custom_config) { if (el) { el.style.display = 'block'; } - callback(); - disable(); + if (false !== callback()) { + disable(); + } } function disable(custom_options) {