Commit
·
cededb6
1
Parent(s):
5e0f175
3. Okt. 2024, 08:02
Browse files- _res/_custom.js +6 -4
_res/_custom.js
CHANGED
@@ -91,6 +91,7 @@ function gradioCustomJS() {
|
|
91 |
//alertModalElem.innerHTML = '<p></p>'
|
92 |
resolutionModalWrapper.appendChild(alertModalElem)
|
93 |
body.appendChild(resolutionModalWrapper)
|
|
|
94 |
|
95 |
// MARK: Alert Modal Events
|
96 |
alertModalElemButton.addEventListener("click", () => {
|
@@ -152,6 +153,7 @@ function gradioCustomJS() {
|
|
152 |
function istMobile() {
|
153 |
// Überprüfen, ob das Gerät ein Touchscreen hat
|
154 |
if ("ontouchstart" in window || (navigator.maxTouchPoints && window.innerWidth < 768)) {
|
|
|
155 |
gradioContainer.classList.add("blur-container")
|
156 |
body.style.setProperty("--blur-value", "12px")
|
157 |
|
@@ -161,6 +163,7 @@ function gradioCustomJS() {
|
|
161 |
alertModalElemButton.textContent = "Ok"
|
162 |
resolutionModalWrapper.style.display = ""
|
163 |
} else if (window.innerWidth < 1024) {
|
|
|
164 |
gradioContainer.classList.add("blur-container")
|
165 |
body.style.setProperty("--blur-value", "12px")
|
166 |
gradioApp.style.height = "calc(100vh - 120px)"
|
@@ -174,10 +177,9 @@ function gradioCustomJS() {
|
|
174 |
gradioApp.style.height = ""
|
175 |
resolutionModalWrapper.style.setProperty("--opacity-value", "0")
|
176 |
resize_eventListener("remove")
|
177 |
-
|
178 |
-
resolutionModalWrapper.style.display = "none"
|
179 |
-
|
180 |
-
}, 800)
|
181 |
}
|
182 |
}
|
183 |
|
|
|
91 |
//alertModalElem.innerHTML = '<p></p>'
|
92 |
resolutionModalWrapper.appendChild(alertModalElem)
|
93 |
body.appendChild(resolutionModalWrapper)
|
94 |
+
let resizeWindowToggleVar = 0
|
95 |
|
96 |
// MARK: Alert Modal Events
|
97 |
alertModalElemButton.addEventListener("click", () => {
|
|
|
153 |
function istMobile() {
|
154 |
// Überprüfen, ob das Gerät ein Touchscreen hat
|
155 |
if ("ontouchstart" in window || (navigator.maxTouchPoints && window.innerWidth < 768)) {
|
156 |
+
resizeWindowToggleVar = 1
|
157 |
gradioContainer.classList.add("blur-container")
|
158 |
body.style.setProperty("--blur-value", "12px")
|
159 |
|
|
|
163 |
alertModalElemButton.textContent = "Ok"
|
164 |
resolutionModalWrapper.style.display = ""
|
165 |
} else if (window.innerWidth < 1024) {
|
166 |
+
resizeWindowToggleVar = 1
|
167 |
gradioContainer.classList.add("blur-container")
|
168 |
body.style.setProperty("--blur-value", "12px")
|
169 |
gradioApp.style.height = "calc(100vh - 120px)"
|
|
|
177 |
gradioApp.style.height = ""
|
178 |
resolutionModalWrapper.style.setProperty("--opacity-value", "0")
|
179 |
resize_eventListener("remove")
|
180 |
+
if (resizeWindowToggleVar == 1) {
|
181 |
+
setTimeout(() => ((resolutionModalWrapper.style.display = "none"), (resizeWindowToggleVar = 0)), 800)
|
182 |
+
}
|
|
|
183 |
}
|
184 |
}
|
185 |
|