Merge pull request #1891 from lostdalek/hotfix/PHRAS-515

PHRAS-515 - fix export by email form submission
This commit is contained in:
Thibaud Fabre
2016-05-30 14:08:58 +02:00

View File

@@ -794,8 +794,8 @@
); );
}); });
$('#sendmail .sendmail_button').bind('click',function(){ var submitEmailForm = function () {
if(!check_subdefs($('#sendmail'))) { if (!check_subdefs($('#sendmail'))) {
return false; return false;
} }
@@ -803,13 +803,19 @@
return false; return false;
} }
if ($('iframe[name=""]').length === 0) { $.post('{{ path('export_mail') }}', $('#sendmail form').serialize(), function (response) {
$('body').append('<iframe style="display:none;" name="sendmail_target"></iframe>');
}
$('#sendmail form').submit();
dialog.Close(); dialog.Close();
}); });
return false;
};
$('#sendmail form').on('submit', function () {
return submitEmailForm();
});
$('#sendmail .sendmail_button').on('click', function () {
return submitEmailForm();
});
$('.datepicker', dialog.getDomElement()).datepicker({ $('.datepicker', dialog.getDomElement()).datepicker({
changeYear: true, changeYear: true,