Show loading icon when loading newsletter preview
This commit is contained in:
@@ -230,15 +230,17 @@ define([
|
|||||||
json.body = JSON.stringify(json.body);
|
json.body = JSON.stringify(json.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MailPoet.Modal.loading(true);
|
||||||
|
|
||||||
MailPoet.Ajax.post({
|
MailPoet.Ajax.post({
|
||||||
endpoint: 'newsletters',
|
endpoint: 'newsletters',
|
||||||
action: 'render',
|
action: 'render',
|
||||||
data: json,
|
data: json,
|
||||||
}).done(function(response){
|
}).done(function(response){
|
||||||
console.log('Should open a new window');
|
MailPoet.Modal.loading(false);
|
||||||
window.open('data:text/html;charset=utf-8,' + encodeURIComponent(response.rendered_body), '_blank');
|
window.open('data:text/html;charset=utf-8,' + encodeURIComponent(response.rendered_body), '_blank');
|
||||||
}).fail(function(error) {
|
}).fail(function(error) {
|
||||||
console.log('Preview error', json);
|
MailPoet.Modal.loading(false);
|
||||||
alert('Something went wrong, check console');
|
alert('Something went wrong, check console');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user