Browse Source

Fix upload.js existing attachment (#3376)

version-14
Faris Ansari 8 years ago
committed by Nabin Hait
parent
commit
dba2f4e8f0
1 changed files with 7 additions and 5 deletions
  1. +7
    -5
      frappe/public/js/frappe/upload.js

+ 7
- 5
frappe/public/js/frappe/upload.js View File

@@ -194,15 +194,17 @@ frappe.upload = {
$(document).on('upload_complete', on_upload); $(document).on('upload_complete', on_upload);


function upload_next() { function upload_next() {
i += 1;
var file = files[i];
args.is_private = file.is_private;
if(files) {
i += 1;
var file = files[i];
args.is_private = file.is_private;
frappe.show_progress(__('Uploading'), i+1, files.length);
}
frappe.upload.upload_file(file, args, opts); frappe.upload.upload_file(file, args, opts);
frappe.show_progress(__('Uploading'), i+1, files.length);
} }


function on_upload(e, attachment) { function on_upload(e, attachment) {
if (i === files.length - 1) {
if (!files || i === files.length - 1) {
$(document).off('upload_complete', on_upload); $(document).off('upload_complete', on_upload);
frappe.hide_progress(); frappe.hide_progress();
return; return;


Loading…
Cancel
Save