mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-06-20 18:08:00 +02:00
Changed textarea to input as @JeLuF suggested, implemented System that should reduce the amount of times the error screen would be shown
This commit is contained in:
parent
b836fd5d0e
commit
79f58881f1
@ -519,11 +519,11 @@
|
||||
<div id="tab-content-gallery" class="tab-content">
|
||||
<div id="gallery-search">
|
||||
<button class="primaryButton" onclick="decrementGalleryPage()"><i class="fa-solid fa-arrow-left"></i></button>
|
||||
<textarea id="gallery-prompt-search" onkeydown="gallery_keyDown_handler(event)" placeholder="Search for a prompt..."></textarea>
|
||||
<textarea id="gallery-model-search" onkeydown="gallery_keyDown_handler(event)" placeholder="Search for a model..."></textarea>
|
||||
<input id="gallery-prompt-search" type="text" onkeydown="gallery_keyDown_handler(event)" placeholder="Search for a prompt..."></input>
|
||||
<input id="gallery-model-search" type="text" onkeydown="gallery_keyDown_handler(event)" placeholder="Search for a model..."></input>
|
||||
<label for="gallery-page">Page:</label>
|
||||
<input id="gallery-page" name="Page" value="0" size="1" onkeypress="gallery_keyDown_handler(event)">
|
||||
<button class="primaryButton" id="gallery-refresh" onclick="refreshGallery()">Load</button>
|
||||
<button class="primaryButton" id="gallery-refresh" onclick="refreshGallery(true)">Load</button>
|
||||
<button class="primaryButton" onclick="incrementGalleryPage()"><i class="fa-solid fa-arrow-right"></i></button>
|
||||
</div>
|
||||
<div class="gallery">
|
||||
|
@ -3108,7 +3108,10 @@ function galleryImage(item) {
|
||||
return div
|
||||
}
|
||||
|
||||
function refreshGallery() {
|
||||
function refreshGallery(newsearch = false) {
|
||||
if (newsearch) {
|
||||
document.getElementById("gallery-page").value = 0
|
||||
}
|
||||
let container = document.getElementById("imagecontainer")
|
||||
let params = new URLSearchParams({
|
||||
prompt: document.getElementById("gallery-prompt-search").value,
|
||||
@ -3134,17 +3137,17 @@ function refreshGallery() {
|
||||
function decrementGalleryPage() {
|
||||
let page = Math.max(document.getElementById("gallery-page").value - 1, 0)
|
||||
document.getElementById("gallery-page").value = page
|
||||
refreshGallery()
|
||||
refreshGallery(false)
|
||||
}
|
||||
|
||||
function incrementGalleryPage() {
|
||||
document.getElementById("gallery-page").value++
|
||||
refreshGallery()
|
||||
refreshGallery(false)
|
||||
}
|
||||
|
||||
function gallery_keyDown_handler(event) {
|
||||
if (event.key === 'Enter') {
|
||||
event.preventDefault()
|
||||
refreshGallery()
|
||||
refreshGallery(true)
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user