Save newsletter before navigating away when clicked on "Next" button

This commit is contained in:
Tautvidas Sipavičius
2017-08-21 18:31:17 +03:00
parent 14810a22b5
commit dcb0b45c21
4 changed files with 40 additions and 34 deletions

View File

@ -321,10 +321,7 @@ define([
MailPoet.Modal.loading(true);
// save before sending
var saveResult = {promise: null};
App.getChannel().trigger('save', saveResult);
saveResult.promise.always(function() {
App.getChannel().request('save').always(function() {
CommunicationComponent.previewNewsletter(data).always(function() {
MailPoet.Modal.loading(false);
}).done(function(response) {