Show lightbox when clicking StaticImage

This commit is contained in:
space-nuko
2023-06-20 02:08:08 -05:00
parent 228ea20dcb
commit 43ed176502

View File

@@ -110,6 +110,16 @@
showMobileLightbox(images, selectedImage, { thumbs: images });
}
function onClickedSingle(e: CustomEvent<GradioSelectData>) {
const images = $nodeValue.map(comfyBoxImageToComfyURL)
if (isMobile) {
showMobileLightbox(images, 0, { thumbs: images });
}
else {
ImageViewer.instance.showModal(images, 0)
}
}
function onClicked(e: CustomEvent<HTMLImageElement>) {
if (isMobile) {
showMobileLightbox_(e.detail, $selected_image)
@@ -136,6 +146,7 @@
value={url}
show_label={widget.attrs.title != ""}
label={widget.attrs.title}
on:select={onClickedSingle}
bind:imageWidth={$imageWidth}
bind:imageHeight={$imageHeight}
/>