mirror of
https://github.com/redmine/redmine.git
synced 2026-05-07 18:17:27 +02:00
Replaces loading and hourglass icons with SVG versions rendered in HTML on attachment upload (#42966).
Patch by Mizuki ISHIKAWA (user:ishikawa999). git-svn-id: https://svn.redmine.org/redmine/trunk@23987 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -45,10 +45,13 @@ function addFile(inputEl, file, eagerUpload) {
|
||||
addFile.nextAttachmentId = 1;
|
||||
|
||||
function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
|
||||
let attachmentIcon = $(fileSpan).find('svg.svg-attachment');
|
||||
|
||||
function onLoadstart(e) {
|
||||
fileSpan.removeClass('ajax-waiting');
|
||||
fileSpan.addClass('ajax-loading');
|
||||
attachmentIcon.addClass('svg-loader');
|
||||
updateSVGIcon(attachmentIcon[0], 'loader')
|
||||
$('input:submit', $(this).parents('form')).attr('disabled', 'disabled');
|
||||
}
|
||||
|
||||
@@ -76,6 +79,8 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
|
||||
}).always(function() {
|
||||
ajaxUpload.uploading--;
|
||||
fileSpan.removeClass('ajax-loading');
|
||||
attachmentIcon.removeClass('svg-loader');
|
||||
updateSVGIcon(attachmentIcon[0], 'attachment');
|
||||
var form = fileSpan.parents('form');
|
||||
if (form.queue('upload').length == 0 && ajaxUpload.uploading == 0) {
|
||||
$('input:submit', form).removeAttr('disabled');
|
||||
@@ -87,6 +92,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
|
||||
var progressSpan = $('<div>').insertAfter(fileSpan.find('input.filename'));
|
||||
progressSpan.progressbar();
|
||||
fileSpan.addClass('ajax-waiting');
|
||||
updateSVGIcon(attachmentIcon[0], 'hourglass');
|
||||
|
||||
var maxSyncUpload = $(inputEl).data('max-concurrent-uploads');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user