diff --git a/includes/version.php b/includes/version.php index 1cd1250..f9d2664 100644 --- a/includes/version.php +++ b/includes/version.php @@ -1,3 +1,3 @@ diff --git a/index.php b/index.php index b63b56d..5e03393 100644 --- a/index.php +++ b/index.php @@ -351,9 +351,9 @@
diff --git a/scripts/settings.js b/scripts/settings.js index 7b1eee5..3bbed9c 100644 --- a/scripts/settings.js +++ b/scripts/settings.js @@ -1102,6 +1102,9 @@ function setTheme(themeColor) { } function resetCustomColors() { + const button = document.getElementById("reset-colors"); + button.disabled = true; + fetch('endpoints/settings/resettheme.php', { method: 'DELETE', }) @@ -1110,7 +1113,9 @@ function resetCustomColors() { if (data.success) { showSuccessMessage(data.message); const custom_theme_colors = document.getElementById('custom_theme_colors'); - custom_theme_colors.remove(); + if (custom_theme_colors) { + custom_theme_colors.remove(); + } document.documentElement.style.removeProperty('--main-color'); document.documentElement.style.removeProperty('--accent-color'); document.documentElement.style.removeProperty('--hover-color'); @@ -1120,13 +1125,18 @@ function resetCustomColors() { } else { showErrorMessage(data.message); } + button.disabled = false; }) .catch(error => { showErrorMessage(translate('unknown_error')); + button.disabled = false; }); } function saveCustomColors() { + const button = document.getElementById("save-colors"); + button.disabled = true; + const mainColor = document.getElementById("mainColor").value; const accentColor = document.getElementById("accentColor").value; const hoverColor = document.getElementById("hoverColor").value; @@ -1148,9 +1158,11 @@ function saveCustomColors() { } else { showErrorMessage(data.message); } + button.disabled = false; }) .catch(error => { showErrorMessage(translate('unknown_error')); + button.disabled = false; }); } \ No newline at end of file diff --git a/settings.php b/settings.php index c6e8c02..2d6ae1d 100644 --- a/settings.php +++ b/settings.php @@ -104,7 +104,7 @@ @@ -170,7 +170,7 @@@@ -248,8 +248,8 @@
@@ -316,7 +316,7 @@ ?> @@ -400,7 +400,7 @@ ?>
@@ -478,7 +478,7 @@