comments
This commit is contained in:
parent
da99e2d262
commit
cbbdc7fb6e
@ -1,3 +1,5 @@
|
|||||||
|
// import mailgo
|
||||||
import mailgo from "../mailgo";
|
import mailgo from "../mailgo";
|
||||||
|
|
||||||
|
// call init mailgo attached to the event DOMContentLoaded
|
||||||
mailgo({ initEvent: "DOMContentLoaded" });
|
mailgo({ initEvent: "DOMContentLoaded" });
|
||||||
|
@ -822,15 +822,15 @@ const mailgoStyle = () => {
|
|||||||
document.head.appendChild(mailgoCSS);
|
document.head.appendChild(mailgoCSS);
|
||||||
};
|
};
|
||||||
|
|
||||||
// export default for mailgo
|
// mailgo
|
||||||
export default (mailgoConfig?: any) => {
|
const mailgo = (mailgoConfig?: any) => {
|
||||||
// if the window is defined...
|
// if the window is defined...
|
||||||
if (window && typeof window !== "undefined") {
|
if (window && typeof window !== "undefined") {
|
||||||
// add the style for mailgo
|
// add the style for mailgo
|
||||||
mailgoStyle();
|
mailgoStyle();
|
||||||
|
|
||||||
// if is set an initEvent add the listener
|
// if is set an initEvent add the listener
|
||||||
if (mailgoConfig.initEvent) {
|
if (mailgoConfig?.initEvent) {
|
||||||
document.addEventListener(mailgoConfig.initEvent, mailgoInit);
|
document.addEventListener(mailgoConfig.initEvent, mailgoInit);
|
||||||
} else {
|
} else {
|
||||||
mailgoInit();
|
mailgoInit();
|
||||||
@ -840,3 +840,5 @@ export default (mailgoConfig?: any) => {
|
|||||||
document.addEventListener("click", mailgoCheckRender);
|
document.addEventListener("click", mailgoCheckRender);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default mailgo;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user