diff options
author | unknown <mcgpapu@gmail.com> | 2023-01-28 09:40:51 +0000 |
---|---|---|
committer | unknown <mcgpapu@gmail.com> | 2023-01-28 09:40:51 +0000 |
commit | e79b7db4b47a33889551b9266ee3277879d4f560 (patch) | |
tree | 1c1944204e58e254bfea22ae44edccdbb54e6b3c /javascript/imageviewer.js | |
parent | b921a52071cf2a5e551c31a6073af6eaebbf7847 (diff) | |
parent | e8a41df49fadd2cf9f23b1f02d75a4947bec5646 (diff) | |
download | stable-diffusion-webui-gfx803-e79b7db4b47a33889551b9266ee3277879d4f560.tar.gz stable-diffusion-webui-gfx803-e79b7db4b47a33889551b9266ee3277879d4f560.tar.bz2 stable-diffusion-webui-gfx803-e79b7db4b47a33889551b9266ee3277879d4f560.zip |
Merge branch 'master' of github.com:AUTOMATIC1111/stable-diffusion-webui into gamepad
Diffstat (limited to 'javascript/imageviewer.js')
-rw-r--r-- | javascript/imageviewer.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/javascript/imageviewer.js b/javascript/imageviewer.js index 0488bfb4..3f7b1289 100644 --- a/javascript/imageviewer.js +++ b/javascript/imageviewer.js @@ -148,9 +148,18 @@ function showGalleryImage() { if(e && e.parentElement.tagName == 'DIV'){ e.style.cursor='pointer' e.style.userSelect='none' - e.addEventListener('click', function (evt) { - if(!opts.js_modal_lightbox) return; + + var isFirefox = isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1 + + // For Firefox, listening on click first switched to next image then shows the lightbox. + // If you know how to fix this without switching to mousedown event, please. + // For other browsers the event is click to make it possiblr to drag picture. + var event = isFirefox ? 'mousedown' : 'click' + + e.addEventListener(event, function (evt) { + if(!opts.js_modal_lightbox || evt.button != 0) return; modalZoomSet(gradioApp().getElementById('modalImage'), opts.js_modal_lightbox_initially_zoomed) + evt.preventDefault() showModal(evt) }, true); } |