1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-09 19:01:42 +00:00

Changed user avatar upload

This commit is contained in:
zhengxie
2012-11-27 21:02:02 +08:00
parent d296b0754b
commit 20c467b0a8
3 changed files with 70 additions and 22 deletions

View File

@@ -52,16 +52,17 @@ $('#upload-file-form .submit').click(function () {
return false;
}
var total = 0;
$.each($('#upload-file-form input[type=file]'), function() {
if($(this).val()) {
total += this.files[0].size;
if (this.files) {
var total = 0;
$.each($('#upload-file-form input[type=file]'), function() {
if($(this).val()) {
total += this.files[0].size;
}
});
if (total > {{ max_upload_file_size }}) {
$('#upload-file-form .error').html('{% trans "File size surpasses the limit." %}').removeClass('hide');
return false;
}
});
if (total > {{ max_upload_file_size }}) {
$('#upload-file-form .error').html('{% trans "File size surpasses the limit." %}').removeClass('hide');
return false;
}
$('#upload-file-form .error').addClass('hide');