From 8f5a71512a77fdf825a6f5ce9dea0cb20cd297cf Mon Sep 17 00:00:00 2001 From: MAEDA Go Date: Mon, 16 Feb 2026 14:32:42 +0900 Subject: [PATCH 1/2] Improve visibility of error message during file upload Patch by Kenta Kumojima (user:kumojima). --- 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'); -- 2.50.1