forgot to add a if {} guard on the CodeMirror instantiation on one use case

This commit is contained in:
Chris Dodge
2012-12-07 15:27:00 -05:00
parent b81f802b1d
commit 402e031ecc

View File

@@ -70,11 +70,13 @@ CMS.Views.ClassInfoUpdateView = Backbone.View.extend({
var $newForm = $(this.template({ updateModel : newModel }));
var $textArea = $newForm.find(".new-update-content").first();
this.$codeMirror = CodeMirror.fromTextArea($textArea.get(0), {
mode: "text/html",
lineNumbers: true,
lineWrapping: true,
});
if (this.$codeMirror == null ) {
this.$codeMirror = CodeMirror.fromTextArea($textArea.get(0), {
mode: "text/html",
lineNumbers: true,
lineWrapping: true,
});
}
var updateEle = this.$el.find("#course-update-list");
$(updateEle).prepend($newForm);