Skip to content
Snippets Groups Projects
Commit 9de2dc51 authored by David Baumgold's avatar David Baumgold
Browse files

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

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