set order attribute on chapters from server

This commit is contained in:
David Baumgold
2013-06-11 16:48:22 -04:00
parent f6ee5cf680
commit ce26d52420

View File

@@ -55,6 +55,9 @@ CMS.Models.Textbook = Backbone.AssociatedModel.extend({
response.chapters = {"url": response.url};
delete response.url;
}
_.each(response.chapters, function(chapter, i) {
chapter.order = chapter.order || i+1;
})
return response;
},
toJSON: function() {