Can't add new textbook if the currently-editing textbook is empty
This commit is contained in:
@@ -250,6 +250,8 @@ CMS.Views.ListTextbooks = Backbone.View.extend({
|
||||
},
|
||||
addOne: function(e) {
|
||||
if(e && e.preventDefault) { e.preventDefault(); }
|
||||
// if the existing edited textbook is empty, don't do anything
|
||||
if(this.collection.editing && this.collection.editing.isEmpty()) { return; }
|
||||
var m = new this.collection.model;
|
||||
this.collection.add(m);
|
||||
this.collection.trigger("editOne", m);
|
||||
|
||||
Reference in New Issue
Block a user