Prevent saving when textbook is in invalid state

This commit is contained in:
David Baumgold
2013-06-25 17:20:59 -04:00
parent 74b9703def
commit fedbf4585b
4 changed files with 34 additions and 10 deletions

View File

@@ -21,7 +21,7 @@ CMS.Models.Textbook = Backbone.AssociatedModel.extend({
this._originalAttributes = this.parse(this.toJSON());
},
reset: function() {
this.set(this._originalAttributes);
this.set(this._originalAttributes, {parse: true});
},
isEmpty: function() {
return !this.get('name') && this.get('chapters').isEmpty();