byElement

This commit is contained in:
Matteo Manzinello 2019-10-28 21:03:22 +01:00
parent 56490623aa
commit 194e277690
3 changed files with 18 additions and 24 deletions

2
dist/mailgo.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -40,7 +40,7 @@
subjectValue,
bodyValue;
// mailgo buttons
// mailgo buttons (actions)
let gmail, outlook, open, telegram, wa, skype, call, copyMail, copyTel;
/**
@ -186,17 +186,7 @@
modalContent.appendChild(copyMail);
// by
let by = document.createElement("a");
by.id = "mailgo.js.org";
by.href = "https://mailgo.js.org?ref=mailgo-modal";
by.className = "mailgo-by";
by.target = "_blank";
by.rel = "noopener noreferrer";
let textBy = document.createTextNode("mailgo.js.org");
by.appendChild(textBy);
modalContent.appendChild(by);
modalContent.appendChild(byElement());
// add the modal at the end of the body
document.body.appendChild(modal);
@ -307,16 +297,7 @@
modalContent.appendChild(copyTel);
// by
let by = document.createElement("a");
by.href = "https://mailgo.js.org?ref=mailgo-modal";
by.className = "mailgo-by";
by.target = "_blank";
by.rel = "noopener noreferrer";
let textBy = document.createTextNode("mailgo.js.org");
by.appendChild(textBy);
modalContent.appendChild(by);
modalContent.appendChild(byElement());
// add the modal at the end of the body
document.body.appendChild(modal);
@ -775,6 +756,19 @@
: false;
};
const byElement = () => {
// by
let by = document.createElement("a");
by.href = "https://mailgo.js.org?ref=mailgo-modal";
by.className = "mailgo-by";
by.target = "_blank";
by.rel = "noopener noreferrer";
let textBy = document.createTextNode("mailgo.js.org");
by.appendChild(textBy);
return by;
};
// window exists
const windowExists = () => window && typeof window !== "undefined";