Save chapter information more frequently

This commit is contained in:
David Baumgold
2013-06-27 16:26:52 -04:00
parent 11c5c14998
commit 2b9ed46440

View File

@@ -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);