Fix #207 - Remove ContentWrapper

This commit is contained in:
Amauri CHAMPEAUX 2018-10-03 07:45:16 +02:00 committed by GitHub
parent 4b40224f35
commit c31b2a1bb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 9 deletions

View File

@ -16,7 +16,7 @@ var scripts = document.getElementsByTagName('script'),
var tarteaucitron = { var tarteaucitron = {
"version": 20180914, "version": 20181003,
"cdn": cdn, "cdn": cdn,
"user": {}, "user": {},
"lang": {}, "lang": {},
@ -397,7 +397,7 @@ var tarteaucitron = {
if (tarteaucitronNoAdBlocker === true || tarteaucitron.parameters.adblocker === false) { if (tarteaucitronNoAdBlocker === true || tarteaucitron.parameters.adblocker === false) {
// create a wrapper container at the same level than tarteaucitron so we can add an aria-hidden when tarteaucitron is opened // create a wrapper container at the same level than tarteaucitron so we can add an aria-hidden when tarteaucitron is opened
var wrapper = document.createElement('div'); /*var wrapper = document.createElement('div');
wrapper.id = "contentWrapper"; wrapper.id = "contentWrapper";
while (document.body.firstChild) while (document.body.firstChild)
@ -406,7 +406,7 @@ var tarteaucitron = {
} }
// Append the wrapper to the body // Append the wrapper to the body
document.body.appendChild(wrapper); document.body.appendChild(wrapper);*/
div.id = 'tarteaucitronRoot'; div.id = 'tarteaucitronRoot';
body.appendChild(div, body); body.appendChild(div, body);
@ -468,7 +468,7 @@ var tarteaucitron = {
html += '<div id="tarteaucitronPremium"></div>'; html += '<div id="tarteaucitronPremium"></div>';
// create wrapper container // create wrapper container
var wrapper = document.createElement('div'); /*var wrapper = document.createElement('div');
wrapper.id = "contentWrapper"; wrapper.id = "contentWrapper";
while (document.body.firstChild) while (document.body.firstChild)
@ -477,7 +477,8 @@ var tarteaucitron = {
} }
// Append the wrapper to the body // Append the wrapper to the body
document.body.appendChild(wrapper); document.body.appendChild(wrapper);*/
div.id = 'tarteaucitronRoot'; div.id = 'tarteaucitronRoot';
body.appendChild(div, body); body.appendChild(div, body);
div.innerHTML = html; div.innerHTML = html;
@ -753,7 +754,7 @@ var tarteaucitron = {
tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none'); tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none');
document.getElementById('tarteaucitronClosePanel').focus(); document.getElementById('tarteaucitronClosePanel').focus();
document.getElementById('contentWrapper').setAttribute("aria-hidden", "true"); //document.getElementById('contentWrapper').setAttribute("aria-hidden", "true");
document.getElementsByTagName('body')[0].classList.add('modal-open'); document.getElementsByTagName('body')[0].classList.add('modal-open');
tarteaucitron.userInterface.focusTrap(); tarteaucitron.userInterface.focusTrap();
tarteaucitron.userInterface.jsSizing('main'); tarteaucitron.userInterface.jsSizing('main');
@ -779,7 +780,7 @@ var tarteaucitron = {
if (document.getElementById('tarteaucitronCloseAlert') !== null) { if (document.getElementById('tarteaucitronCloseAlert') !== null) {
document.getElementById('tarteaucitronCloseAlert').focus(); document.getElementById('tarteaucitronCloseAlert').focus();
} }
document.getElementById('contentWrapper').setAttribute("aria-hidden", "false"); //document.getElementById('contentWrapper').setAttribute("aria-hidden", "false");
document.getElementsByTagName('body')[0].classList.remove('modal-open'); document.getElementsByTagName('body')[0].classList.remove('modal-open');
}, },