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

@@ -556,6 +556,8 @@ var mailgo_mailgoInit = function mailgoInit(mailgoConfig) {
var mailgoRender = function mailgoRender() {
var _config7;
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : MAIL_TYPE;
var mailgoElement = arguments.length > 1 ? arguments[1] : undefined;
@@ -654,12 +656,16 @@ var mailgoRender = function mailgoRender() {
copyTel.addEventListener("click", function () {
return 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 config.dark is set to true then all the modals will be in dark mode
if (mailgoElement.classList.contains("dark")) {
enableDarkMode(type);
if (!((_config7 = config) === null || _config7 === void 0 ? void 0 : _config7.dark)) {
// if the element contains dark as class enable dark mode
if (mailgoElement.classList.contains("dark")) {
enableDarkMode(type);
} else {
disableDarkMode(type);
}
} // show the mailgo

File diff suppressed because one or more lines are too long