Mails + Upload

This commit is contained in:
Kevin Adametz 2020-06-14 13:49:11 +02:00
parent 767e84e640
commit a3bef8d1aa
19 changed files with 151 additions and 200 deletions

View file

@ -35,6 +35,14 @@
<script type="text/javascript">
var responseRedirect = undefined;
$('#modals-load-content').on('hide.bs.modal', function (event) {
$(this).off('hide.bs.modal');
if(responseRedirect){
window.location.href = responseRedirect;
}
});
$( document ).ready(function() {
Dropzone.autoDiscover = false;
$("#uploadModalFile").dropzone({
@ -76,18 +84,21 @@
message = response.message;
var _ele = $('.alert-danger');
_ele.fadeIn();
console.log(message);
$(file.previewElement).find('.dz-error-message').text(message);
$(file.previewElement).addClass('dz-error');
_ele.text(message);
},
success: function(file, response) {
console.log(file);
console.log(response);
//console.log(file);
//console.log(response);
$(file.previewElement).addClass('dz-success');
if(response.error === false){
if(response.redirect){
window.location.href = response.redirect
responseRedirect = response.redirect;
// window.location.href = response.redirect
}else{
//window.location.href = window.location.href; //This is a possibility
window.location.reload(); //Another possiblity
// window.location.reload(); //Another possiblity
}
}
}