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

persist textbook deletions to the server

parent 486baced
No related merge requests found
......@@ -75,7 +75,7 @@ CMS.Views.TextbookShow = Backbone.View.extend({
tagName: "li",
events: {
"click .edit": "editTextbook",
"click .delete": "removeSelf",
"click .delete": "delete",
"click .show-chapters": "showChapters",
"click .hide-chapters": "hideChapters"
},
......@@ -87,9 +87,24 @@ CMS.Views.TextbookShow = Backbone.View.extend({
if(e && e.preventDefault) { e.preventDefault(); }
this.model.collection.trigger("editOne", this.model);
},
removeSelf: function(e) {
delete: function(e) {
if(e && e.preventDefault) { e.preventDefault(); }
this.model.collection.remove(this.model);
var collection = this.model.collection;
collection.remove(this.model);
msg = new CMS.Models.SystemFeedback({
intent: "saving",
title: gettext("Deleting…")
});
notif = new CMS.Views.Notification({
model: msg,
closeIcon: false,
minShown: 1250
});
collection.save({
complete: function() {
notif.hide();
}
});
},
showChapters: function(e) {
if(e && e.preventDefault) { e.preventDefault(); }
......
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