mirror of
https://github.com/vladmandic/automatic
synced 2026-09-17 16:24:33 +02:00
fix delete file from main gallery view
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -60,6 +60,17 @@ function selected_gallery_index() {
|
||||
return result;
|
||||
}
|
||||
|
||||
function selected_gallery_files() {
|
||||
let allImages = [];
|
||||
try {
|
||||
let allCurrentButtons = gradioApp().querySelectorAll('[style="display: block;"].tabitem div[id$=_gallery].gradio-gallery .thumbnail-item.thumbnail-small');
|
||||
if (allCurrentButtons.length === 0) allCurrentButtons = gradioApp().querySelectorAll('.gradio-gallery .thumbnails > .thumbnail-item.thumbnail-small');
|
||||
allImages = Array.from(allCurrentButtons).map((v) => v.querySelector('img')?.src);
|
||||
} catch { /**/ }
|
||||
const selectedIndex = selected_gallery_index();
|
||||
return [allImages, selectedIndex];
|
||||
}
|
||||
|
||||
function extract_image_from_gallery(gallery) {
|
||||
if (gallery.length === 0) return [null];
|
||||
if (gallery.length === 1) return [gallery[0]];
|
||||
|
||||
Reference in New Issue
Block a user