Skip to content

Commit

Permalink
bug fix: deposit button disabled when there are no uploaded files
Browse files Browse the repository at this point in the history
  • Loading branch information
emanueldima committed Mar 26, 2014
1 parent adca0ce commit 2669e6a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions simplestore/etc/static/js/simplestore-deposit.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,17 @@ function simplestore_init_plupload(selector, url, delete_url, get_file_url) {
});

function setDepositBtnState() {
var nowUploading = false;
var disableDeposit = false;
if (!uploader.files.length) {
disableDeposit = true;
}
$.each(uploader.files, function(i, file) {
if (file.loaded < file.size) {
nowUploading = true;
disableDeposit = true;
}
});
$('#deposit').toggleClass('disabled', nowUploading)
.attr('disabled', nowUploading ? 'disabled' : null);
$('#deposit').toggleClass('disabled', disableDeposit)
.attr('disabled', disableDeposit ? 'disabled' : null);
}

uploader.init();
Expand Down

0 comments on commit 2669e6a

Please sign in to comment.