Show lightbox when clicking StaticImage
This commit is contained in:
@@ -110,6 +110,16 @@
|
|||||||
showMobileLightbox(images, selectedImage, { thumbs: images });
|
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>) {
|
function onClicked(e: CustomEvent<HTMLImageElement>) {
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
showMobileLightbox_(e.detail, $selected_image)
|
showMobileLightbox_(e.detail, $selected_image)
|
||||||
@@ -136,6 +146,7 @@
|
|||||||
value={url}
|
value={url}
|
||||||
show_label={widget.attrs.title != ""}
|
show_label={widget.attrs.title != ""}
|
||||||
label={widget.attrs.title}
|
label={widget.attrs.title}
|
||||||
|
on:select={onClickedSingle}
|
||||||
bind:imageWidth={$imageWidth}
|
bind:imageWidth={$imageWidth}
|
||||||
bind:imageHeight={$imageHeight}
|
bind:imageHeight={$imageHeight}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user