This commit is contained in:
Amauri CHAMPEAUX 2020-03-05 17:03:00 +01:00
commit 6726dd2e8a
1 changed files with 19 additions and 2 deletions

View File

@ -225,6 +225,7 @@ var tarteaucitron = {
"cookieName": 'tarteaucitron',
"highPrivacy": true,
"orientation": "middle",
"bodyPosition": "bottom",
"removeCredit": false,
"showAlertSmall": true,
"cookieslist": true,
@ -468,7 +469,15 @@ var tarteaucitron = {
document.body.appendChild(wrapper);*/
div.id = 'tarteaucitronRoot';
body.appendChild(div, body);
if (tarteaucitron.parameters.bodyPosition === 'top') {
// Prepend tarteaucitron: #tarteaucitronRoot first-child of the body for better accessibility
var bodyFirstChild = body.firstChild;
body.insertBefore(div, bodyFirstChild);
}
else {
// Append tarteaucitron: #tarteaucitronRoot last-child of the body
body.appendChild(div, body);
}
div.innerHTML = html;
//ie compatibility
@ -539,7 +548,15 @@ var tarteaucitron = {
html += '<div id="tarteaucitronPremium"></div>';
div.id = 'tarteaucitronRoot';
body.appendChild(div, body);
if (tarteaucitron.parameters.bodyPosition === 'top') {
// Prepend tarteaucitron: #tarteaucitronRoot first-child of the body for better accessibility
var bodyFirstChild = body.firstChild;
body.insertBefore(div, bodyFirstChild);
}
else {
// Append tarteaucitron: #tarteaucitronRoot last-child of the body
body.appendChild(div, body);
}
div.innerHTML = html;
}
}, 1500);