summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-03-07 12:26:33 +0300
committerAndrew Dolgov <[email protected]>2021-03-07 12:26:33 +0300
commit773bad1490504bcda346193ad4c93bf1d9610ab6 (patch)
tree5ebedc699d66ebab1a2e842a48aa6556ebfe9006 /js
parent1dcc36deca5bcc6e845a227927d847acfd520807 (diff)
prevent list of enabled plugins resetting if saved while in search results
Diffstat (limited to 'js')
-rw-r--r--js/PrefHelpers.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/js/PrefHelpers.js b/js/PrefHelpers.js
index d9b17a698..04ee10a41 100644
--- a/js/PrefHelpers.js
+++ b/js/PrefHelpers.js
@@ -356,6 +356,7 @@ const Helpers = {
++results_rendered;
+ // only user-enabled actually counts in the checkbox when saving because system plugin checkboxes are disabled (see below)
container.innerHTML += `
<li data-row-value="${App.escapeHtml(plugin.name)}" data-plugin-name="${App.escapeHtml(plugin.name)}" title="${plugin.is_system ? __("System plugins are enabled using global configuration.") : ""}">
<label class="checkbox ${plugin.is_system ? "system text-info" : ""}">
@@ -387,11 +388,14 @@ const Helpers = {
<div class='version text-muted'>${plugin.version}</div>
</li>
`;
+ } else {
+ // if plugin is outside of search scope, keep current value in case of saving (only user-enabled is needed)
+ container.innerHTML += App.FormFields.checkbox_tag("plugins[]", plugin.user_enabled, plugin.name, {style: 'display : none'});
}
});
if (results_rendered == 0) {
- container.innerHTML = `<li class='text-center text-info'>${__("Could not find any plugins for this search query.")}</li>`;
+ container.innerHTML += `<li class='text-center text-info'>${__("Could not find any plugins for this search query.")}</li>`;
}
dojo.parser.parse(container);