File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -131,19 +131,15 @@ function setupImageForLightbox(e) {
131131 e . style . cursor = 'pointer' ;
132132 e . style . userSelect = 'none' ;
133133
134- var isFirefox = navigator . userAgent . toLowerCase ( ) . indexOf ( 'firefox' ) > - 1 ;
135-
136- // For Firefox, listening on click first switched to next image then shows the lightbox.
137- // If you know how to fix this without switching to mousedown event, please.
138- // For other browsers the event is click to make it possiblr to drag picture.
139- var event = isFirefox ? 'mousedown' : 'click' ;
140-
141- e . addEventListener ( event , function ( evt ) {
134+ e . addEventListener ( 'mousedown' , function ( evt ) {
142135 if ( evt . button == 1 ) {
143136 open ( evt . target . src ) ;
144137 evt . preventDefault ( ) ;
145138 return ;
146139 }
140+ } , true ) ;
141+
142+ e . addEventListener ( 'click' , function ( evt ) {
147143 if ( ! opts . js_modal_lightbox || evt . button != 0 ) return ;
148144
149145 modalZoomSet ( gradioApp ( ) . getElementById ( 'modalImage' ) , opts . js_modal_lightbox_initially_zoomed ) ;
You can’t perform that action at this time.
0 commit comments