Merge pull request #12379 from diegocr/dev

Allow to open images in new browser tab by MMB.
This commit is contained in:
AUTOMATIC1111 2023-08-07 17:48:13 +03:00 committed by GitHub
commit 251140fc88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -136,6 +136,11 @@ function setupImageForLightbox(e) {
var event = isFirefox ? 'mousedown' : 'click';
e.addEventListener(event, function(evt) {
if (evt.button == 1) {
open(evt.target.src);
evt.preventDefault();
return;
}
if (!opts.js_modal_lightbox || evt.button != 0) return;
modalZoomSet(gradioApp().getElementById('modalImage'), opts.js_modal_lightbox_initially_zoomed);