miglioramenti css
This commit is contained in:
parent
17bbcfec96
commit
e3483cec6e
@ -1,20 +1,14 @@
|
||||
function mailgoInit() {
|
||||
const styles = `
|
||||
.mailgo {
|
||||
all: initial;
|
||||
* {
|
||||
all: unset;
|
||||
}
|
||||
}
|
||||
.mailgo-title {
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.mailgo-details {
|
||||
font-size: 12px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.mailgo-details p {
|
||||
font-size: 12px;
|
||||
margin-top: 3px;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
@ -102,7 +96,15 @@ function mailgoInit() {
|
||||
|
||||
// attivo mailgo su tutti gli elementi
|
||||
mailgos.forEach(function(mailgo, index) {
|
||||
let mail = mailgo.href
|
||||
let mail = "",
|
||||
cc = "",
|
||||
bcc = "",
|
||||
subject = "",
|
||||
bodyMail = "";
|
||||
|
||||
// caso in cui applico mailgo ad un <a> con mailto:
|
||||
if (mailgo.href.includes("mailto:")) {
|
||||
mail = mailgo.href
|
||||
.split("?")[0]
|
||||
.split("mailto:")[1]
|
||||
.trim();
|
||||
@ -110,15 +112,21 @@ function mailgoInit() {
|
||||
let url = new URL(mailgo.href);
|
||||
let urlParams = new URLSearchParams(url.search);
|
||||
|
||||
let cc = urlParams.get("cc");
|
||||
let bcc = urlParams.get("bcc");
|
||||
let subject = urlParams.get("subject");
|
||||
let bodyMail = urlParams.get("body");
|
||||
cc = urlParams.get("cc");
|
||||
bcc = urlParams.get("bcc");
|
||||
subject = urlParams.get("subject");
|
||||
bodyMail = urlParams.get("body");
|
||||
} else {
|
||||
// caso in cui applico mailgo ad <a> con class="mailgo"
|
||||
mail =
|
||||
mailgo.getAttribute("data-address") +
|
||||
"@" +
|
||||
mailgo.getAttribute("data-domain");
|
||||
}
|
||||
|
||||
if (!validateEmail(mail)) return;
|
||||
|
||||
let modal = document.createElement("div");
|
||||
modal.classList.add("mailgo");
|
||||
modal.classList.add("mailgo-modal");
|
||||
modal.setAttribute("data-index", index);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user