Skip to content

Commit

Permalink
ability to upload a new file in a single upload field after a file ha…
Browse files Browse the repository at this point in the history
…s already been uploaded
  • Loading branch information
molily committed Dec 7, 2009
1 parent 099ca9c commit 86b07a7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions public/vrame/javascripts/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ function Upload (containerEl) {
file_size_limit : 20 * 1024, /* That's 20 Megabytes */
file_types : '*.*', /* All file types */
file_types_description : 'Files',
file_upload_limit : o.uploadType == 'asset' ? 1 : 0, /* Single or multiple file upload */
file_upload_limit : 0,
file_queue_limit : o.uploadType == 'asset' ? 1 : 0, /* Single or multiple file upload */

/* POST parameters with authentication and relation ids */
post_params : postParams,
Expand Down Expand Up @@ -230,10 +231,15 @@ Upload.prototype.handlers = {
/* Append item to asset list */
settings.assetList.append(response.asset_list_item);
} else {
/* Replace asset list items */
/* Replace asset list item */
settings.assetList.html(response.asset_list_item);
}

/* Allow the user to upload a new file if it's a single upload field */
if (settings.uploadType == 'asset') {
this.setFileQueueLimit(1);
}

//console.log('uploadSuccess ended', file.name);
},

Expand Down

0 comments on commit 86b07a7

Please sign in to comment.