aboutsummaryrefslogtreecommitdiff
path: root/javascript/ui.js
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-10-21 16:51:01 +0300
committerGitHub <noreply@github.com>2022-10-21 16:51:01 +0300
commitec37f8a45f316db8a20445aa80afd602457327b0 (patch)
tree20a59fe67602feeff3ba6e023f823a314294e78e /javascript/ui.js
parent003d2c7fe427edde299274c9e0d5fa59734e7f7e (diff)
parent85cb5918ee7c97cafafe4149880ed82f1933d919 (diff)
Merge branch 'master' into features-to-readme
Diffstat (limited to 'javascript/ui.js')
-rw-r--r--javascript/ui.js7
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')