From 402e031eccf5b6e9299bb547f965c0afe31ce4bc Mon Sep 17 00:00:00 2001 From: Chris Dodge Date: Fri, 7 Dec 2012 15:27:00 -0500 Subject: [PATCH] forgot to add a if {} guard on the CodeMirror instantiation on one use case --- cms/static/js/views/course_info_edit.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cms/static/js/views/course_info_edit.js b/cms/static/js/views/course_info_edit.js index 19ed03fff9..9f662a0697 100644 --- a/cms/static/js/views/course_info_edit.js +++ b/cms/static/js/views/course_info_edit.js @@ -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);