mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-06-21 10:27:47 +02:00
Implemented suggestions by @JeLuF
This commit is contained in:
parent
a3b97c2b47
commit
76604d22de
@ -3257,7 +3257,7 @@ function layoutGallery() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function refreshGallery(newsearch = false) {
|
function refreshGallery(newsearch = false) {
|
||||||
let BUTTONS = [...document.getElementById("gallery-search").children].filter(x => x.tagName === "BUTTON")
|
let buttons = document.querySelectorAll("#gallery-search button")
|
||||||
if (newsearch) {
|
if (newsearch) {
|
||||||
document.getElementById("gallery-page").value = 0
|
document.getElementById("gallery-page").value = 0
|
||||||
}
|
}
|
||||||
@ -3299,15 +3299,15 @@ function refreshGallery(newsearch = false) {
|
|||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(json => {
|
.then(json => {
|
||||||
if (json.length == 0) {
|
if (json.length == 0) {
|
||||||
BUTTONS[2].disabled = true
|
buttons[2].disabled = true
|
||||||
} else {
|
} else {
|
||||||
BUTTONS[2].disabled = false
|
buttons[2].disabled = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (document.getElementById("gallery-page").value == 0) {
|
if (document.getElementById("gallery-page").value == 0) {
|
||||||
BUTTONS[0].disabled = true
|
buttons[0].disabled = true
|
||||||
} else {
|
} else {
|
||||||
BUTTONS[0].disabled = false
|
buttons[0].disabled = false
|
||||||
}
|
}
|
||||||
document.getElementById("gallery-refresh").innerText = "Refresh"
|
document.getElementById("gallery-refresh").innerText = "Refresh"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user