diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2022-10-18 11:04:26 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-18 11:04:26 +0000 |
commit | c07dbd4cf9831b1f785c01a6dec409c0338a41ab (patch) | |
tree | dd1a7276d6d43f950227e54dbae28fbf6801d35b /javascript/ui.js | |
parent | c71008c74156635558bb2e877d1628913f6f781e (diff) | |
parent | f6c758d055ca8e181d5bfc056cb85ff5a2df7f66 (diff) | |
download | stable-diffusion-webui-gfx803-c07dbd4cf9831b1f785c01a6dec409c0338a41ab.tar.gz stable-diffusion-webui-gfx803-c07dbd4cf9831b1f785c01a6dec409c0338a41ab.tar.bz2 stable-diffusion-webui-gfx803-c07dbd4cf9831b1f785c01a6dec409c0338a41ab.zip |
Merge pull request #2939 from Michoko92/dark-mode
Added dark mode switch
Diffstat (limited to 'javascript/ui.js')
-rw-r--r-- | javascript/ui.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/javascript/ui.js b/javascript/ui.js index 9e1bed4c..cfd0dcd3 100644 --- a/javascript/ui.js +++ b/javascript/ui.js @@ -1,5 +1,12 @@ // various functions for interation with ui.py not large enough to warrant putting them in separate files +function set_theme(theme){ + gradioURL = window.location.href + if (!gradioURL.includes('?__theme=')) { + window.location.replace(gradioURL + '?__theme=' + theme); + } +} + function selected_gallery_index(){ var buttons = gradioApp().querySelectorAll('[style="display: block;"].tabitem .gallery-item') var button = gradioApp().querySelector('[style="display: block;"].tabitem .gallery-item.\\!ring-2') |