⚙ settings saving improvements + refactor - DB lock v0.1 #685

This commit is contained in:
jokob-sk
2024-05-29 19:24:43 +10:00
parent 3853b8a4ec
commit bb2beda12a
10 changed files with 334 additions and 302 deletions

View File

@@ -186,17 +186,24 @@ function modalWarningOK() {
}
// -----------------------------------------------------------------------------
function showMessage(textMessage = "") {
function showMessage(textMessage = "", timeout = 3000, colorClass = "modal_green") {
if (textMessage.toLowerCase().includes("error")) {
// show error
alert(textMessage);
} else {
// show temporal notification
// show temporary notification
$("#notification").removeClass(); // remove all classes
$("#notification").addClass("alert alert-dimissible notification_modal"); // add default ones
$("#notification").addClass(colorClass); // add color modifiers
// message
$("#alert-message").html(textMessage);
// timeout
$("#notification").fadeIn(1, function () {
window.setTimeout(function () {
$("#notification").fadeOut(500);
}, 3000);
}, timeout);
});
}
}