From 0048c8209269dc6f014cb27b6896d4df2ca73371 Mon Sep 17 00:00:00 2001 From: David Baumgold Date: Mon, 24 Jun 2013 15:08:23 -0400 Subject: [PATCH] Simply context passing for textbooks --- cms/static/js/views/textbook.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cms/static/js/views/textbook.js b/cms/static/js/views/textbook.js index 7a137d2edf..16ff5444c8 100644 --- a/cms/static/js/views/textbook.js +++ b/cms/static/js/views/textbook.js @@ -172,8 +172,8 @@ CMS.Views.ListTextbooks = Backbone.View.extend({ if(textbooks.length === 0) { this.$el.html(this.emptyTemplate()); } else { - var $el = this.$el; - $el.empty(); + this.$el.empty(); + var that = this; textbooks.each(function(textbook) { var view; if (textbook === textbooks.editing) { @@ -181,7 +181,7 @@ CMS.Views.ListTextbooks = Backbone.View.extend({ } else { view = new CMS.Views.ShowTextbook({model: textbook}); } - $el.append(view.render().el); + that.$el.append(view.render().el); }); } return this;