Put CSS on the .css file and set onclick as an event #572

This commit is contained in:
Amauri CHAMPEAUX 2021-02-16 10:46:34 +01:00
parent 054dba819b
commit ececa37bf3
2 changed files with 15 additions and 7 deletions

View File

@ -869,6 +869,15 @@ span.tarteaucitronTitle.tarteaucitronH3 {
margin-top: 12px!important; margin-top: 12px!important;
} }
#tarteaucitronCloseCross {
position:absolute;
color: #FFFF;
font-size:1.8rem;
cursor: pointer;
top: 10px;
right: 26px
}
.spacer-20 { .spacer-20 {
height: 20px; height: 20px;
display: block; display: block;

View File

@ -582,12 +582,8 @@ var tarteaucitron = {
let element = document.getElementById('tarteaucitronAlertBig'); let element = document.getElementById('tarteaucitronAlertBig');
let span = document.createElement('span') let span = document.createElement('span')
span.textContent = 'X'; span.textContent = 'X';
span.style.cssText = 'position:absolute; color: #FFFF; font-size:2rem; cursor: pointer; top: 10px; right: 26px'; span.setAttribute('id', "tarteaucitronCloseCross")
span.setAttribute('id', "clossCross")
element.insertBefore(span, element.firstElementChild) element.insertBefore(span, element.firstElementChild)
document.getElementById("clossCross").onclick = () =>{
tarteaucitron.userInterface.closeAlert();
}
} }
@ -596,6 +592,9 @@ var tarteaucitron = {
setTimeout(function () { setTimeout(function () {
// Setup events // Setup events
tarteaucitron.addClickEventToId("tarteaucitronCloseCross", function () {
tarteaucitron.userInterface.closeAlert();
});
tarteaucitron.addClickEventToId("tarteaucitronPersonalize", function () { tarteaucitron.addClickEventToId("tarteaucitronPersonalize", function () {
tarteaucitron.userInterface.openPanel(); tarteaucitron.userInterface.openPanel();
}); });
@ -872,11 +871,11 @@ var tarteaucitron = {
index = 0; index = 0;
for (index = 0; index < tarteaucitron.job.length; index += 1) { for (index = 0; index < tarteaucitron.job.length; index += 1) {
if (typeof type !== 'undefined' && s[tarteaucitron.job[index]].type !== type) { if (typeof type !== 'undefined' && s[tarteaucitron.job[index]].type !== type) {
continue; continue;
} }
service = s[tarteaucitron.job[index]]; service = s[tarteaucitron.job[index]];
key = service.key; key = service.key;
if (tarteaucitron.state[key] !== status) { if (tarteaucitron.state[key] !== status) {