Better UX for max files exceeded

merge-requests/18/head
Mike Koch 8 years ago
parent 5418f834fe
commit 75ecd7d579

@ -254,7 +254,8 @@ function display_dropzone_field($url, $id = 'filedrop') {
if (numberOfFiles >= " . $max_files . ") {
disabled = true;
}
$('." . $id . "-button').attr('disabled', disabled);
$('." . $id . "button-" . $id . "').attr('disabled', disabled);
});
this.on('removedfile', function(file) {
// Remove the attachment from the database and the filesystem.
@ -266,7 +267,7 @@ function display_dropzone_field($url, $id = 'filedrop') {
if (numberOfFiles >= " . $max_files . ") {
disabled = true;
}
$('." . $id . "-button').attr('disabled', disabled);
$('." . $id . "button-" . $id . "').attr('disabled', disabled);
});
this.on('complete', function(file) {
// Stop animating if complete.
@ -281,6 +282,9 @@ function display_dropzone_field($url, $id = 'filedrop') {
this.on('uploadprogress', function(file, percentage) {
$(file.previewTemplate).find('#percentage').text(percentage + '%');
});
this.on('error', function(file, errorMessage, xhr) {
$(file.previewTemplate).addClass('alert-danger');
});
},
paramName: 'attachment',
url: '" . $url . "',
@ -297,6 +301,7 @@ function display_dropzone_field($url, $id = 'filedrop') {
dictCancelUpload: ".json_encode($hesklang['attachment_cancel']).",
dictCancelUploadConfirmation: ".json_encode($hesklang['attachment_confirm_cancel']).",
dictRemoveFile: ".json_encode($hesklang['attachment_remove']).",
dictMaxFilesExceeded: ".json_encode($hesklang['attachment_max_exceeded']).",
previewTemplate: $('#previews').html(),
clickable: '.filedropbutton-".$id."',
uploadMultiple: false

@ -109,6 +109,7 @@ $hesklang['select_all_title_case'] = 'Select All';
$hesklang['deselect_all_title_case'] = 'Deselect All';
$hesklang['event'] = 'Event';
$hesklang['overdue_ticket_legend'] = 'Overdue ticket';
$hesklang['attachment_max_exceeded'] = 'This file will not be uploaded becuase you have already uploaded the maximum number of files allowed.';
// ADDED OR MODIFIED IN Mods for HESK 2.5.2
$hesklang['manage_statuses'] = 'Manage Statuses';

Loading…
Cancel
Save