mirror of
https://github.com/go-gitea/gitea
synced 2024-09-26 19:19:00 +02:00
Fix js error in edit issue and improve image type check
This commit is contained in:
parent
ce5745233c
commit
48cf2a5127
2 changed files with 2 additions and 2 deletions
|
@ -118,7 +118,7 @@ async function handleClipboardFiles(editor, dropzone, files, e) {
|
||||||
|
|
||||||
file.uuid = uuid;
|
file.uuid = uuid;
|
||||||
dropzone.dropzone.emit('addedfile', file);
|
dropzone.dropzone.emit('addedfile', file);
|
||||||
if (/\.(jpg|jpeg|png|gif|bmp)$/i.test(file.name)) {
|
if (file.type?.startsWith('image/')) {
|
||||||
const imgSrc = `/attachments/${file.uuid}`;
|
const imgSrc = `/attachments/${file.uuid}`;
|
||||||
dropzone.dropzone.emit('thumbnail', file, imgSrc);
|
dropzone.dropzone.emit('thumbnail', file, imgSrc);
|
||||||
dropzone.querySelector(`img[src='${imgSrc}']`).style.maxWidth = '100%';
|
dropzone.querySelector(`img[src='${imgSrc}']`).style.maxWidth = '100%';
|
||||||
|
|
|
@ -259,7 +259,7 @@ export function isElemVisible(element) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getComboMarkdownEditor(el) {
|
export function getComboMarkdownEditor(el) {
|
||||||
if (el.jquery) el = el[0];
|
if (el?.jquery) el = el[0];
|
||||||
return el?._giteaComboMarkdownEditor;
|
return el?._giteaComboMarkdownEditor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue