Improve visibility of error message during file upload (#43381).

Patch by Kenta Kumojima (user:kumojima).


git-svn-id: https://svn.redmine.org/redmine/trunk@24439 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2026-02-20 22:45:03 +00:00
parent e3b47b663a
commit dd9cbfcf6d

View File

@@ -73,14 +73,16 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
addInlineAttachmentMarkup(file);
progressSpan.progressbar( 'value', 100 ).remove();
fileSpan.find('input.description, a').css('display', 'inline-flex');
updateSVGIcon(attachmentIcon[0], 'file');
})
.fail(function(result) {
progressSpan.text(result.statusText);
$('<span>').insertAfter(progressSpan).text(result.statusText);
progressSpan.remove();
updateSVGIcon(attachmentIcon[0], 'warning');
}).always(function() {
ajaxUpload.uploading--;
fileSpan.removeClass('ajax-loading');
attachmentIcon.removeClass('svg-loader');
updateSVGIcon(attachmentIcon[0], 'file');
var form = fileSpan.parents('form');
if (form.queue('upload').length == 0 && ajaxUpload.uploading == 0) {
$('input:submit', form).removeAttr('disabled');