Fix for script tags w/in json objects being oddly evaluated on html page

load by doing load separately. In process, upgraded backbone which
necessitated changing getByCid to get and got rid of obsolete
course_settings master object.
This commit is contained in:
Don Mitchell
2013-03-01 16:05:58 -05:00
parent d186e5d186
commit e55bb845b2
4 changed files with 42 additions and 80 deletions

View File

@@ -44,6 +44,8 @@ CMS.Views.ClassInfoUpdateView = Backbone.View.extend({
self.render();
}
);
// when the client refetches the updates as a whole, re-render them
this.listenTo(this.collection, 'reset', this.render);
},
render: function () {
@@ -150,7 +152,7 @@ CMS.Views.ClassInfoUpdateView = Backbone.View.extend({
},
closeEditor: function(self, removePost) {
var targetModel = self.collection.getByCid(self.$currentPost.attr('name'));
var targetModel = self.collection.get(self.$currentPost.attr('name'));
if(removePost) {
self.$currentPost.remove();
@@ -172,7 +174,7 @@ CMS.Views.ClassInfoUpdateView = Backbone.View.extend({
// Dereferencing from events to screen elements
eventModel: function(event) {
// not sure if it should be currentTarget or delegateTarget
return this.collection.getByCid($(event.currentTarget).attr("name"));
return this.collection.get($(event.currentTarget).attr("name"));
},
modelDom: function(event) {