Merge pull request #351 from c3do/patch-1

Déplacer la correction de mainTop
This commit is contained in:
Amauri CHAMPEAUX 2019-09-08 07:41:02 +02:00 committed by GitHub
commit 2e6b6db44d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -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');
}