working on typescript and ssr problems...

This commit is contained in:
Matteo Manzinello 2020-04-24 15:57:07 +02:00
parent dd8c7cde9b
commit 1606a2b30a
3 changed files with 18 additions and 13 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

@ -825,9 +825,13 @@ const mailgo = (config?: MailgoConfig) => {
// start mailgo // start mailgo
(() => { (() => {
// if the window is defined...
if (window && typeof window !== "undefined") {
// if the window object exists... // if the window object exists...
// mailgo style (gulp) // mailgo style (gulp)
let mailgoCSS: HTMLStyleElement = <HTMLStyleElement>createElement("style"); let mailgoCSS: HTMLStyleElement = <HTMLStyleElement>(
createElement("style")
);
mailgoCSS.id = "mailgo-style"; mailgoCSS.id = "mailgo-style";
mailgoCSS.type = "text/css"; mailgoCSS.type = "text/css";
mailgoCSS.appendChild(createTextNode(`MAILGO_STYLE`)); mailgoCSS.appendChild(createTextNode(`MAILGO_STYLE`));
@ -838,6 +842,7 @@ const mailgo = (config?: MailgoConfig) => {
// event listener on body, if the element is mailgo-compatible the mailgo modal will be rendered // event listener on body, if the element is mailgo-compatible the mailgo modal will be rendered
document.addEventListener("click", mailgoCheckRender); document.addEventListener("click", mailgoCheckRender);
}
})(); })();
}; };