From dd9cbfcf6d4f65649cf06903a2266abe618f58c0 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Fri, 20 Feb 2026 22:45:03 +0000 Subject: [PATCH] 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 --- app/assets/javascripts/attachments.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/attachments.js b/app/assets/javascripts/attachments.js index b710af8b0..1650386b8 100644 --- a/app/assets/javascripts/attachments.js +++ b/app/assets/javascripts/attachments.js @@ -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); + $('').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');