created dark mode (both dark.min.js or class = dark), as issue #41

This commit is contained in:
Matteo Manzinello
2020-07-16 20:25:29 +02:00
parent 00965a58a3
commit 36857577b9
8 changed files with 27 additions and 13 deletions

View File

@@ -551,10 +551,14 @@ const mailgoRender = (
copyTel.addEventListener("click", () => copy(tel));
}
// dark mode as class of the element
// check only if is present to set the dark mode, because if the dark mode is set in config it have not to be disabled
if (mailgoElement.classList.contains("dark")) {
enableDarkMode(type);
// if config.dark is set to true then all the modals will be in dark mode
if (!config?.dark) {
// if the element contains dark as class enable dark mode
if (mailgoElement.classList.contains("dark")) {
enableDarkMode(type);
} else {
disableDarkMode(type);
}
}
// show the mailgo