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