Allow to open images in new browser tab by MMB.

Signed-off-by: Diego Casorran <dcasorran@gmail.com>
This commit is contained in:
Diego Casorran 2023-08-07 14:53:42 +02:00
parent 5a38a9c0ee
commit aea0fa9fd5
No known key found for this signature in database
GPG Key ID: 978D40FBFB9C2F3D

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);