Spaces:
Sleeping
Sleeping
Keldos
commited on
Commit
•
ae0a24e
1
Parent(s):
562142e
WIP: fix both menu and toolbox open
Browse files
web_assets/javascript/webui.js
CHANGED
@@ -40,6 +40,7 @@ function showSideMask() {
|
|
40 |
if (windowWidth < 1024) {
|
41 |
if (gradioApp().querySelector('#menu-area').classList.contains('showSide') && gradioApp().querySelector('#toolbox-area').classList.contains('showSide')) {
|
42 |
gradioApp().querySelector('#toolbox-area').classList.remove('showSide');
|
|
|
43 |
// if both menu and toolbox are open, close toolbox...
|
44 |
}
|
45 |
}
|
@@ -102,6 +103,8 @@ function closeSide() {
|
|
102 |
gradioApp().querySelector('#menu-area').classList.remove('showSide');
|
103 |
gradioApp().querySelector('#toolbox-area').classList.remove('showSide');
|
104 |
|
|
|
|
|
105 |
}
|
106 |
|
107 |
function menuClick() {
|
@@ -118,11 +121,15 @@ function menuClick() {
|
|
118 |
|
119 |
function toolboxClick() {
|
120 |
var toolbox = gradioApp().querySelector('#toolbox-area');
|
|
|
121 |
if (toolbox.classList.contains('showSide')) {
|
122 |
toolbox.classList.remove('showSide');
|
123 |
chuanhuHeader.classList.remove('under-box');
|
124 |
closeSide();
|
125 |
} else {
|
|
|
|
|
|
|
126 |
toolbox.classList.add('showSide');
|
127 |
chuanhuHeader.classList.add('under-box');
|
128 |
showSideMask();
|
|
|
40 |
if (windowWidth < 1024) {
|
41 |
if (gradioApp().querySelector('#menu-area').classList.contains('showSide') && gradioApp().querySelector('#toolbox-area').classList.contains('showSide')) {
|
42 |
gradioApp().querySelector('#toolbox-area').classList.remove('showSide');
|
43 |
+
chuanhuHeader.classList.remove('under-box');
|
44 |
// if both menu and toolbox are open, close toolbox...
|
45 |
}
|
46 |
}
|
|
|
103 |
gradioApp().querySelector('#menu-area').classList.remove('showSide');
|
104 |
gradioApp().querySelector('#toolbox-area').classList.remove('showSide');
|
105 |
|
106 |
+
chuanhuHeader.classList.remove('under-box');
|
107 |
+
|
108 |
}
|
109 |
|
110 |
function menuClick() {
|
|
|
121 |
|
122 |
function toolboxClick() {
|
123 |
var toolbox = gradioApp().querySelector('#toolbox-area');
|
124 |
+
var menu = gradioApp().querySelector('#menu-area');
|
125 |
if (toolbox.classList.contains('showSide')) {
|
126 |
toolbox.classList.remove('showSide');
|
127 |
chuanhuHeader.classList.remove('under-box');
|
128 |
closeSide();
|
129 |
} else {
|
130 |
+
if (menu.classList.contains('showSide')) {
|
131 |
+
menu.classList.remove('showSide');
|
132 |
+
}
|
133 |
toolbox.classList.add('showSide');
|
134 |
chuanhuHeader.classList.add('under-box');
|
135 |
showSideMask();
|