Do not redirect when newsletter is invalid
This commit is contained in:
@@ -67,7 +67,8 @@ define([
|
|||||||
initialize: function(options) {
|
initialize: function(options) {
|
||||||
App.getChannel().on('beforeEditorSave', this.beforeSave, this);
|
App.getChannel().on('beforeEditorSave', this.beforeSave, this);
|
||||||
App.getChannel().on('afterEditorSave', this.afterSave, this);
|
App.getChannel().on('afterEditorSave', this.afterSave, this);
|
||||||
|
},
|
||||||
|
onRender: function() {
|
||||||
this.validateNewsletter(App.toJSON());
|
this.validateNewsletter(App.toJSON());
|
||||||
},
|
},
|
||||||
save: function() {
|
save: function() {
|
||||||
@@ -126,8 +127,10 @@ define([
|
|||||||
},
|
},
|
||||||
next: function() {
|
next: function() {
|
||||||
this.hideOptionContents();
|
this.hideOptionContents();
|
||||||
console.log('Next');
|
if(!this.$('.mailpoet_save_next').hasClass('button-disabled')) {
|
||||||
window.location.href = App.getConfig().get('urls.send');
|
console.log('Next');
|
||||||
|
window.location.href = App.getConfig().get('urls.send');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
validateNewsletter: function(jsonObject) {
|
validateNewsletter: function(jsonObject) {
|
||||||
if (!App._contentContainer.isValid()) {
|
if (!App._contentContainer.isValid()) {
|
||||||
|
Reference in New Issue
Block a user