Commit 01ff8396 by cahrens

Fix CodeMirror initialization problem.

parent 235ecff2
......@@ -113,14 +113,16 @@ class CMS.Views.ModuleEdit extends Backbone.View
settingsModeButton = @$el.find('#settings-mode').find("a")
if mode == @editorMode
dataEditor.addClass('is-active')
settingsEditor.removeClass('is-active')
# Because of CodeMirror editor, cannot hide the data editor when it is first loaded. Therefore
# we have to use a class of is-inactive instead of is-active.
dataEditor.removeClass('is-inactive')
editorModeButton.addClass('is-set')
settingsEditor.removeClass('is-active')
settingsModeButton.removeClass('is-set')
else
dataEditor.removeClass('is-active')
settingsEditor.addClass('is-active')
dataEditor.addClass('is-inactive')
editorModeButton.removeClass('is-set')
settingsEditor.addClass('is-active')
settingsModeButton.addClass('is-set')
hideDataEditor: =>
......
......@@ -535,12 +535,14 @@ body.course.unit {
// Editor Wrapper
.wrapper-comp-editor {
display: none;
display: block;
&.is-active {
display: block;
// Because the editor may be a CodeMirror editor (which must be visible at the time it is created
// in order for it to properly initialize), we must toggle "is-inactive" instead of the more common "is-active".
&.is-inactive {
display: none;
}
}
}
// Settings Wrapper
.wrapper-comp-settings {
......
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