mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-23 10:35:04 +08:00
Fix remove file on initial comment (#20127)
Store the file uuid(which is returned by Gitea in the upload file response) onto the file object, so it can be used for the remove feature to specify this file. Fix #20115
This commit is contained in:
parent
2111741a48
commit
a8cdea013d
|
@ -192,7 +192,8 @@ export function initGlobalDropzone() {
|
||||||
thumbnailWidth: 480,
|
thumbnailWidth: 480,
|
||||||
thumbnailHeight: 480,
|
thumbnailHeight: 480,
|
||||||
init() {
|
init() {
|
||||||
this.on('success', (_file, data) => {
|
this.on('success', (file, data) => {
|
||||||
|
file.uuid = data.uuid;
|
||||||
const input = $(`<input id="${data.uuid}" name="files" type="hidden">`).val(data.uuid);
|
const input = $(`<input id="${data.uuid}" name="files" type="hidden">`).val(data.uuid);
|
||||||
$dropzone.find('.files').append(input);
|
$dropzone.find('.files').append(input);
|
||||||
});
|
});
|
||||||
|
|
|
@ -300,6 +300,7 @@ async function onEditContent(event) {
|
||||||
thumbnailHeight: 480,
|
thumbnailHeight: 480,
|
||||||
init() {
|
init() {
|
||||||
this.on('success', (file, data) => {
|
this.on('success', (file, data) => {
|
||||||
|
file.uuid = data.uuid;
|
||||||
fileUuidDict[file.uuid] = {submitted: false};
|
fileUuidDict[file.uuid] = {submitted: false};
|
||||||
const input = $(`<input id="${data.uuid}" name="files" type="hidden">`).val(data.uuid);
|
const input = $(`<input id="${data.uuid}" name="files" type="hidden">`).val(data.uuid);
|
||||||
$dropzone.find('.files').append(input);
|
$dropzone.find('.files').append(input);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user