diff --git a/cms/static/js/views/textbook.js b/cms/static/js/views/textbook.js index 907cddd239..89d2b0cb5c 100644 --- a/cms/static/js/views/textbook.js +++ b/cms/static/js/views/textbook.js @@ -219,10 +219,22 @@ CMS.Views.EditChapter = Backbone.View.extend({ return this; }, events: { + "change .chapter-name": "changeName", + "change .chapter-asset-path": "changeAssetPath", "click .action-close": "removeChapter", "click .action-upload": "openUploadDialog", "submit": "uploadAsset" }, + changeName: function(e) { + if(e && e.preventDefault) { e.preventDefault(); } + this.model.set("name", this.$(".chapter-name").val()); + return this; + }, + changeAssetPath: function(e) { + if(e && e.preventDefault) { e.preventDefault(); } + this.model.set("asset_path", this.$(".chapter-asset-path").val()); + return this; + }, removeChapter: function(e) { if(e && e.preventDefault) { e.preventDefault(); } this.model.collection.remove(this.model);