introducing mailgoConfig in window

This commit is contained in:
Matteo Manzinello
2020-07-29 15:50:38 +02:00
parent a7c0f7e48c
commit cbec242435
12 changed files with 122 additions and 31 deletions

View File

@@ -263,7 +263,7 @@ const mailgoInit = (): void => {
// show mailgo.dev in footer only if showFooter == true
if (
typeof config?.showFooter !== "undefined" &&
typeof config?.showFooter === "undefined" ||
config?.showFooter === false
) {
modalContent.appendChild(byElement());
@@ -393,7 +393,7 @@ const mailgoInit = (): void => {
// show mailgo.dev in footer only if showFooter == true
if (
typeof config?.showFooter !== "undefined" &&
typeof config?.showFooter === "undefined" ||
config?.showFooter === false
) {
modalContent.appendChild(byElement());
@@ -1035,8 +1035,8 @@ const mailgoStyle = (): void => {
// mailgo
function mailgo(mailgoConfig?: MailgoConfig): void {
// set the global config
config = mailgoConfig;
// set the global config if passed as parameter or keep it from window
config = mailgoConfig || (window as any)?.mailgoConfig;
// if the window is defined...
if (window && typeof window !== "undefined") {