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