Add a timer on the closeelement

This commit is contained in:
Amauri CHAMPEAUX 2021-04-28 12:14:04 +02:00
parent 4cf393cd40
commit b091e07cc5
1 changed files with 9 additions and 5 deletions

View File

@ -595,11 +595,15 @@ var tarteaucitron = {
}, 1500); }, 1500);
} }
if(tarteaucitron.parameters.closePopup === true){ if(tarteaucitron.parameters.closePopup === true){
var closeElement = document.getElementById('tarteaucitronAlertBig'), setTimeout(function() {
closeSpan = document.createElement('span'); var closeElement = document.getElementById('tarteaucitronAlertBig'),
closeSpan.textContent = 'X'; closeSpan = document.createElement('span');
closeSpan.setAttribute('id', "tarteaucitronCloseCross"); if (closeElement) {
closeElement.insertBefore(closeSpan, closeElement.firstElementChild); closeSpan.textContent = 'X';
closeSpan.setAttribute('id', "tarteaucitronCloseCross");
closeElement.insertBefore(closeSpan, closeElement.firstElementChild);
}
}, 100);
} }