Commit 0048c820 by David Baumgold

Simply context passing for textbooks

parent 5836286f
...@@ -172,8 +172,8 @@ CMS.Views.ListTextbooks = Backbone.View.extend({ ...@@ -172,8 +172,8 @@ CMS.Views.ListTextbooks = Backbone.View.extend({
if(textbooks.length === 0) { if(textbooks.length === 0) {
this.$el.html(this.emptyTemplate()); this.$el.html(this.emptyTemplate());
} else { } else {
var $el = this.$el; this.$el.empty();
$el.empty(); var that = this;
textbooks.each(function(textbook) { textbooks.each(function(textbook) {
var view; var view;
if (textbook === textbooks.editing) { if (textbook === textbooks.editing) {
...@@ -181,7 +181,7 @@ CMS.Views.ListTextbooks = Backbone.View.extend({ ...@@ -181,7 +181,7 @@ CMS.Views.ListTextbooks = Backbone.View.extend({
} else { } else {
view = new CMS.Views.ShowTextbook({model: textbook}); view = new CMS.Views.ShowTextbook({model: textbook});
} }
$el.append(view.render().el); that.$el.append(view.render().el);
}); });
} }
return this; return this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment