Improve ajax errors on form submission

[MAILPOET-929]
This commit is contained in:
Pavel Dohnal 2017-06-26 13:42:05 +01:00
parent 99c4fc71c4
commit 836b7179e9
2 changed files with 8 additions and 0 deletions

View File

@ -112,6 +112,13 @@ class Widget {
'ajax_url' => admin_url('admin-ajax.php'),
'is_rtl' => (function_exists('is_rtl') ? (bool)is_rtl() : false)
));
$ajaxFailedErrorMessage = __('An error has happened while performing a request, please try again later.');
wp_add_inline_script(
'mailpoet_public',
sprintf('MailPoet.I18n.add("ajaxFailedErrorMessage", "%s")', $ajaxFailedErrorMessage),
'after'
);
}
function setupAdminWidgetPageDependencies() {

View File

@ -248,6 +248,7 @@ var publicConfig = {
entry: {
public: [
'mailpoet',
'i18n',
'ajax',
'iframe',
'jquery.serialize_object',