Upload starts automatically when Javascript is enabled

This commit is contained in:
Christoph Haas 2016-08-31 18:08:16 +02:00
parent 52590d866e
commit 4ee670e438
2 changed files with 10 additions and 6 deletions

View file

@ -40,7 +40,8 @@ load_reviews = function() {
// Initialize the upload form.
upload_form_init = function() {
// Disable the submit button until files are selected.
// Disable the submit button if Javascript is supported.
// Upload will start right after selecting images.
$('#file-submit').hide();
// Install event handler to notice when files were selected.
@ -50,8 +51,8 @@ upload_form_init = function() {
upload_form_files_selected = function() {
no_files = this.files.length;
if (no_files > 0) {
$('#file-label').html(no_files+" files selected");
$('#file-select-button').addClass('success');
$('#file-submit').fadeIn('slow');
$('#file-label').html(no_files+" files selected - uploading…"); // change label
$('#file-select-button').attr('disabled','disabled'); // disable select button
$('#file-form').submit(); // start upload
}
};