Fix "Preview in browser" notice to display a proper success message
This commit is contained in:
@ -247,17 +247,18 @@ define([
|
||||
action: 'showPreview',
|
||||
data: json,
|
||||
}).done(function(response){
|
||||
MailPoet.Modal.loading(false);
|
||||
|
||||
if (response.result === true) {
|
||||
window.open(response.data.url, '_blank')
|
||||
MailPoet.Notice.success(MailPoet.I18n.t('previewShouldOpenInNewTab'));
|
||||
} else {
|
||||
MailPoet.Notice.error(response.errors);
|
||||
}
|
||||
MailPoet.Notice.error(response.errors);
|
||||
}).fail(function(error) {
|
||||
MailPoet.Modal.loading(false);
|
||||
MailPoet.Notice.error(
|
||||
MailPoet.I18n.t('newsletterPreviewFailed')
|
||||
);
|
||||
}).always(function() {
|
||||
MailPoet.Modal.loading(false);
|
||||
});
|
||||
},
|
||||
sendPreview: function() {
|
||||
|
@ -329,6 +329,7 @@
|
||||
'templateSaveFailed': __('Template has not been saved, please try again'),
|
||||
'categoriesAndTags': __('Categories & tags'),
|
||||
'noPostsToDisplay': __('There is no content to display'),
|
||||
'previewShouldOpenInNewTab': __('Your preview should open in a new tab. Please ensure your browser is not blocking popups from this page.'),
|
||||
}) %>
|
||||
<% endblock %>
|
||||
|
||||
|
Reference in New Issue
Block a user