Do not redirect when newsletter is invalid

This commit is contained in:
Tautvidas Sipavičius
2015-10-01 14:34:53 +03:00
parent 39b2a2ad40
commit 671befbfd8

View File

@@ -67,7 +67,8 @@ define([
initialize: function(options) {
App.getChannel().on('beforeEditorSave', this.beforeSave, this);
App.getChannel().on('afterEditorSave', this.afterSave, this);
},
onRender: function() {
this.validateNewsletter(App.toJSON());
},
save: function() {
@@ -126,8 +127,10 @@ define([
},
next: function() {
this.hideOptionContents();
console.log('Next');
window.location.href = App.getConfig().get('urls.send');
if(!this.$('.mailpoet_save_next').hasClass('button-disabled')) {
console.log('Next');
window.location.href = App.getConfig().get('urls.send');
}
},
validateNewsletter: function(jsonObject) {
if (!App._contentContainer.isValid()) {