Set file upload progressbar responsive

This commit is contained in:
ClemDee 2019-07-19 11:36:43 +02:00
parent b49c39b895
commit b74f7b5ec2

View File

@ -106,10 +106,14 @@ define([
var $pc = $row.find('.cp-fileupload-table-progress'); var $pc = $row.find('.cp-fileupload-table-progress');
var $link = $row.find('.cp-fileupload-table-link'); var $link = $row.find('.cp-fileupload-table-link');
/**
* Update progress in the download panel, for uploading a file
* @param {number} progressValue Progression of download, between 0 and 100
*/
updateProgress = function (progressValue) { updateProgress = function (progressValue) {
$pv.text(Math.round(progressValue*100)/100 + '%'); $pv.text(Math.round(progressValue * 100) / 100 + '%');
$pb.css({ $pb.css({
width: (progressValue/100)*$pc.width()+'px' width: progressValue + '%'
}); });
}; };
@ -537,20 +541,28 @@ define([
queue.next(); queue.next();
}; };
/**
* Update progress in the download panel, for downloading a file
* @param {number} progressValue Progression of download, between 0 and 1
*/
var updateDLProgress = function (progressValue) { var updateDLProgress = function (progressValue) {
var text = Math.round(progressValue*100) + '%'; var text = Math.round(progressValue * 100) + '%';
text += ' ('+ Messages.download_step1 +'...)'; text += ' ('+ Messages.download_step1 + '...)';
$pv.text(text); $pv.text(text);
$pb.css({ $pb.css({
width: progressValue * $pc.width()+'px' width: (progressValue * 100) + '%'
}); });
}; };
/**
* Update progress in the download panel, for decrypting a file (after downloading it)
* @param {number} progressValue Progression of download, between 0 and 1
*/
var updateProgress = function (progressValue) { var updateProgress = function (progressValue) {
var text = Math.round(progressValue*100) + '%'; var text = Math.round(progressValue * 100) + '%';
text += progressValue === 1 ? '' : ' ('+ Messages.download_step2 +'...)'; text += progressValue === 1 ? '' : ' (' + Messages.download_step2 + '...)';
$pv.text(text); $pv.text(text);
$pb.css({ $pb.css({
width: progressValue * $pc.width()+'px' width: (progressValue * 100) + '%'
}); });
}; };