aboutsummaryrefslogtreecommitdiffstats
path: root/javascript
diff options
context:
space:
mode:
authorMartín (Netux) Rodríguez <send.email@netux.site>2023-06-25 03:30:08 +0000
committerMartín (Netux) Rodríguez <send.email@netux.site>2023-06-25 03:48:46 +0000
commitdd268c48c9099c4cf308eb04590bd201c9b64253 (patch)
tree499712c01d854defc5368d05cecf9f114cb5aa1a /javascript
parent59419bd64a1581caccaac04dceb66c1c069a2db1 (diff)
downloadstable-diffusion-webui-gfx803-dd268c48c9099c4cf308eb04590bd201c9b64253.tar.gz
stable-diffusion-webui-gfx803-dd268c48c9099c4cf308eb04590bd201c9b64253.tar.bz2
stable-diffusion-webui-gfx803-dd268c48c9099c4cf308eb04590bd201c9b64253.zip
feat(extensions): add toggle all checkbox to Installed tab
Small QoL addition. While there is the option to disable all extensions with the radio buttons at the top, that only acts as an added flag and doesn't really change the state of the extensions in the UI. An use case for this checkbox is to disable all extensions except for a few, which is important for debugging extensions. You could do that before, but you'd have to uncheck and recheck every extension one by one.
Diffstat (limited to 'javascript')
-rw-r--r--javascript/extensions.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/javascript/extensions.js b/javascript/extensions.js
index efeaf3a5..1f7254c5 100644
--- a/javascript/extensions.js
+++ b/javascript/extensions.js
@@ -72,3 +72,21 @@ function config_state_confirm_restore(_, config_state_name, config_restore_type)
}
return [confirmed, config_state_name, config_restore_type];
}
+
+function toggle_all_extensions(event) {
+ gradioApp().querySelectorAll('#extensions .extension_toggle').forEach(function(checkbox_el) {
+ checkbox_el.checked = event.target.checked;
+ });
+}
+
+function toggle_extension() {
+ let all_extensions_toggled = true;
+ for (const checkbox_el of gradioApp().querySelectorAll('#extensions .extension_toggle')) {
+ if (!checkbox_el.checked) {
+ all_extensions_toggled = false;
+ break;
+ }
+ }
+
+ gradioApp().querySelector('#extensions .all_extensions_toggle').checked = all_extensions_toggled;
+}