@@ -4,6 +4,7 @@ import {getComboMarkdownEditor, initComboMarkdownEditor} from './comp/ComboMarkd
44import { createDropzone } from './dropzone.js' ;
55import { GET , POST } from '../modules/fetch.js' ;
66import { hideElem , showElem } from '../utils/dom.js' ;
7+ import { isImageFile } from '../utils/image.js' ;
78import { attachRefIssueContextPopup } from './contextpopup.js' ;
89import { initCommentContent , initMarkupContent } from '../markup/content.js' ;
910
@@ -84,10 +85,12 @@ async function onEditContent(event) {
8485 for ( const attachment of data ) {
8586 const imgSrc = `${ dropzone . getAttribute ( 'data-link-url' ) } /${ attachment . uuid } ` ;
8687 dz . emit ( 'addedfile' , attachment ) ;
87- dz . emit ( 'thumbnail' , attachment , imgSrc ) ;
88+ if ( isImageFile ( attachment . name ) ) {
89+ dz . emit ( 'thumbnail' , attachment , imgSrc ) ;
90+ dropzone . querySelector ( `img[src='${ imgSrc } ']` ) . style . maxWidth = '100%' ;
91+ }
8892 dz . emit ( 'complete' , attachment ) ;
8993 fileUuidDict [ attachment . uuid ] = { submitted : true } ;
90- dropzone . querySelector ( `img[src='${ imgSrc } ']` ) . style . maxWidth = '100%' ;
9194 const input = document . createElement ( 'input' ) ;
9295 input . id = attachment . uuid ;
9396 input . name = 'files' ;
0 commit comments