Commit 5254af29 by Don Mitchell

Letting render do its thing. The wrap confused the this pointer.

parent 4718c9a5
...@@ -26,11 +26,6 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({ ...@@ -26,11 +26,6 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
} }
); );
this.model.on('error', this.handleValidationError, this); this.model.on('error', this.handleValidationError, this);
this.render = _.wrap(this.render, function(render) {
render();
self.afterRender();
return self;
});
}, },
render: function() { render: function() {
// catch potential outside call before template loaded // catch potential outside call before template loaded
...@@ -50,12 +45,6 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({ ...@@ -50,12 +45,6 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
self.fieldToSelectorMap[key] = key; self.fieldToSelectorMap[key] = key;
}); });
return this;
},
afterRender: function () {
var self = this;
var listEle$ = this.$el.find('.course-advanced-policy-list');
var policyValueDivs = listEle$.find('.ace'); var policyValueDivs = listEle$.find('.ace');
_.each(policyValueDivs, _.each(policyValueDivs,
function (div) { function (div) {
...@@ -75,6 +64,7 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({ ...@@ -75,6 +64,7 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
// Seems to be OK in afterRender method. // Seems to be OK in afterRender method.
editor.getSession().setMode("ace/mode/json"); editor.getSession().setMode("ace/mode/json");
}); });
return this;
}, },
deleteEntry : function(event) { deleteEntry : function(event) {
......
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