Commit 9de2dc51 by David Baumgold

Can't add new textbook if the currently-editing textbook is empty

parent c0b00f7d
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment