From a7c0f7e48ccc2b3d2a5d6e2c7d6cd5e771b7febd Mon Sep 17 00:00:00 2001 From: Matteo Manzinello Date: Wed, 29 Jul 2020 10:08:11 +0200 Subject: [PATCH] working on new parameter: showFooter to hide or not the mailgo.dev in the footer of the modal --- mailgo.d.ts | 1 + src/mailgo.ts | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/mailgo.d.ts b/mailgo.d.ts index abc0253..d7694fa 100644 --- a/mailgo.d.ts +++ b/mailgo.d.ts @@ -11,6 +11,7 @@ declare module "mailgo" { forceLang?: boolean; validateEmail?: boolean; validateTel?: boolean; + showFooter?: boolean; }; export type MailgoTranslation = { diff --git a/src/mailgo.ts b/src/mailgo.ts index 8aac12b..2ecca39 100644 --- a/src/mailgo.ts +++ b/src/mailgo.ts @@ -261,7 +261,13 @@ const mailgoInit = (): void => { modalContent.appendChild(copyMail); - modalContent.appendChild(byElement()); + // show mailgo.dev in footer only if showFooter == true + if ( + typeof config?.showFooter !== "undefined" && + config?.showFooter === false + ) { + modalContent.appendChild(byElement()); + } // add the modal at the end of the body document.body.appendChild(modalMailto); @@ -385,7 +391,13 @@ const mailgoInit = (): void => { modalContent.appendChild(copyTel); - modalContent.appendChild(byElement()); + // show mailgo.dev in footer only if showFooter == true + if ( + typeof config?.showFooter !== "undefined" && + config?.showFooter === false + ) { + modalContent.appendChild(byElement()); + } // add the modal at the end of the body document.body.appendChild(modalTel);