From ce26d5242019314b2a63b634955d25decc489b2d Mon Sep 17 00:00:00 2001 From: David Baumgold Date: Tue, 11 Jun 2013 16:48:22 -0400 Subject: [PATCH] set order attribute on chapters from server --- cms/templates/textbooks.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cms/templates/textbooks.html b/cms/templates/textbooks.html index 4c31adb5c4..b46e0f73a4 100644 --- a/cms/templates/textbooks.html +++ b/cms/templates/textbooks.html @@ -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() {