Commit 83602d80 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

Move save failure message above options

With the number of options in there, it can be easily missed.

Differential Revision: https://phabricator.kde.org/D24204
parent 552241e2
......@@ -36,6 +36,10 @@
<a data-i18n="general_error_startup_failed_wiki_link" href="https://community.kde.org/Plasma/Browser_Integration" target="_blank">I18N</a>
</div>
<div id="save-failure-info" class="hidden">
<p id="save-message"></p>
</div>
<ul id="extensions-selection">
<li>
<label>
......@@ -86,10 +90,6 @@
<p data-i18n="options_plugin_breezeScrollBars_description" data-i18n-html="true">I18N</p>
</li>
</ul>
<div class="dialog-button-box">
<span id="save-message"></span>
</div>
</div>
<div class="tab" data-tab-id="about">
......
......@@ -64,18 +64,21 @@ function loadSettings() {
updateDependencies(control, key, settingsKey);
control.addEventListener("change", () => {
let saveMessage = document.getElementById("save-message");
saveMessage.innerText = "";
let saveFailureInfoElement = document.getElementById("save-failure-info");
saveFailureInfoElement.classList.add("hidden");
updateDependencies(control, key, settingsKey);
saveSettings((error) => {
if (error) {
saveFailureInfoElement.classList.remove("hidden");
let saveMessageElement = document.getElementById("save-message");
try {
saveMessage.innerText = chrome.i18n.getMessage("options_save_failed");
saveMessageElement.innerText = chrome.i18n.getMessage("options_save_failed");
} catch (e) {
// When the extension is reloaded, any call to extension APIs throws, make sure we show at least some form of error
saveMessage.innerText = "Saving settings failed (" + (error || e) + ")";
saveMessageElement.innerText = "Saving settings failed (" + (error || e) + ")";
}
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment