From 8d048bea8766577ddce9993e7efadf70cd7fd961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric?= <35066297+c3do@users.noreply.github.com> Date: Thu, 5 Sep 2019 12:21:07 +0200 Subject: [PATCH] =?UTF-8?q?D=C3=A9placer=20la=20correction=20de=20mainTop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Permet d'éviter un mainTop négatif. --- tarteaucitron.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tarteaucitron.js b/tarteaucitron.js index 594ca6b..67536da 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -1043,17 +1043,17 @@ var tarteaucitron = { mainTop = ((windowInnerHeight - document.getElementById('tarteaucitron').offsetHeight) / 2) - 21; } - // correct - if (mainTop < 0) { - mainTop = 0; - } - if (document.getElementById('tarteaucitronMainLineOffset') !== null) { if (document.getElementById('tarteaucitron').offsetHeight < (windowInnerHeight / 2)) { mainTop -= document.getElementById('tarteaucitronMainLineOffset').offsetHeight; } } + // correct + if (mainTop < 0) { + mainTop = 0; + } + // apply tarteaucitron.userInterface.css('tarteaucitron', 'top', mainTop + 'px'); }