From 9de2dc51ec06409e2d383b7643515874e0d8c525 Mon Sep 17 00:00:00 2001 From: David Baumgold Date: Wed, 12 Jun 2013 11:04:51 -0400 Subject: [PATCH] Can't add new textbook if the currently-editing textbook is empty --- cms/templates/textbooks.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cms/templates/textbooks.html b/cms/templates/textbooks.html index fee8c5e321..ccda44d1fc 100644 --- a/cms/templates/textbooks.html +++ b/cms/templates/textbooks.html @@ -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);