From 01ab6b0b46f744893cc814da60abc4e73169c6f8 Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Sun, 7 Jun 2015 19:01:55 +0200 Subject: [PATCH] Scroll feature only if the small alert is on --- tarteaucitron.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tarteaucitron.js b/tarteaucitron.js index 93aff60..52ffad2 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -41,7 +41,7 @@ var tarteaucitron = { window.addEventListener("scroll", function () { var scrollPos = window.pageYOffset || document.documentElement.scrollTop, heightPosition; - if (document.getElementById('tarteaucitronAlertBig') !== null && !tarteaucitron.highPrivacy) { + if (document.getElementById('tarteaucitronAlertBig') !== null && tarteaucitron.showsmall && !tarteaucitron.highPrivacy) { if (document.getElementById('tarteaucitronAlertBig').style.display === 'block') { heightPosition = document.getElementById('tarteaucitronAlertBig').offsetHeight + 'px'; @@ -95,7 +95,7 @@ var tarteaucitron = { window.attachEvent("onscroll", function () { var scrollPos = window.pageYOffset || document.documentElement.scrollTop, heightPosition; - if (document.getElementById('tarteaucitronAlertBig') !== null && !tarteaucitron.highPrivacy) { + if (document.getElementById('tarteaucitronAlertBig') !== null && tarteaucitron.showsmall && !tarteaucitron.highPrivacy) { if (document.getElementById('tarteaucitronAlertBig').style.display === 'block') { heightPosition = document.getElementById('tarteaucitronAlertBig').offsetHeight + 'px'; @@ -191,6 +191,7 @@ var tarteaucitron = { } // global + tarteaucitron.showsmall = defaults.showAlertSmall; tarteaucitron.orientation = defaults.orientation; tarteaucitron.hashtag = defaults.hashtag; tarteaucitron.highPrivacy = defaults.highPrivacy;