added a check for #mailgo or #mailgo-tel already existing in the page

This commit is contained in:
Matteo Manzinello
2020-07-31 15:41:54 +02:00
parent cb0dcb128b
commit cf8ff056c8
11 changed files with 20 additions and 17 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+6 -4
View File
@@ -316,9 +316,9 @@ var mailgoInit = function mailgoInit() {
var defaultStrings = translations[DEFAULT_LANG];
var strings = translations[lang]; // mailgo mail
var strings = translations[lang]; // mailgo tel, if mailgo not already exists
{
if (!document.getElementById("mailgo")) {
var _config3, _config4, _config5;
// modal
@@ -447,9 +447,10 @@ var mailgoInit = function mailgoInit() {
document.body.appendChild(modalMailto); // every click outside the modal will hide the modal
modalBackground.addEventListener("click", hideMailgo);
} // mailgo tel
} // mailgo tel, if mailgo-tel not already exists
{
if (!document.getElementById("mailgo-tel")) {
var _config6, _config7, _config8;
// modal
@@ -563,6 +564,7 @@ var mailgoInit = function mailgoInit() {
_modalBackground.addEventListener("click", hideMailgo);
} // event listener on body, if the element is mailgo-compatible the mailgo modal will be rendered
document.addEventListener("click", mailgoCheckRender);
};
/**
+1 -1
View File
File diff suppressed because one or more lines are too long
+5 -4
View File
@@ -112,8 +112,8 @@ const mailgoInit = (): void => {
let defaultStrings: MailgoTranslation = translations[DEFAULT_LANG];
let strings: MailgoTranslation = translations[lang];
// mailgo mail
{
// mailgo tel, if mailgo not already exists
if (!document.getElementById("mailgo")) {
// modal
modalMailto = createElement() as HTMLElement;
modalMailto.style.display = "none";
@@ -275,8 +275,9 @@ const mailgoInit = (): void => {
// every click outside the modal will hide the modal
modalBackground.addEventListener("click", hideMailgo);
}
// mailgo tel
{
// mailgo tel, if mailgo-tel not already exists
if (!document.getElementById("mailgo-tel")) {
// modal
modalTel = createElement() as HTMLElement;
modalTel.style.display = "none";