mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-05 07:03:51 +08:00
refactor
This commit is contained in:
parent
9f1e436623
commit
b56913cc87
1 changed files with 5 additions and 1 deletions
|
@ -161,10 +161,14 @@ function filesSizeValidator(ev, fileInputs, fileTypeEnum) {
|
|||
|
||||
// Check if any file exceeds allowed size limit
|
||||
var filesSizeValid = true;
|
||||
|
||||
// Check total size of uploaded files
|
||||
var totalSizeOK = checkFilesTotalSize(fileInputs);
|
||||
|
||||
_.each(fileInputs, function(fileInput) {
|
||||
var file = fileInput.files[0];
|
||||
var assetError = getFileTooBigError(file);
|
||||
var assetError = checkFilesTotalSize(fileInputs);
|
||||
var assetError = totalSizeOK;
|
||||
if (assetError) {
|
||||
renderFormError(ev, fileInput, assetError, false, "data-error='file-size'");
|
||||
filesSizeValid = false;
|
||||
|
|
Loading…
Reference in a new issue