Merge pull request #799 from MITx/feature/cale/cms-codemirror-background

Feature/cale/cms codemirror background
This commit is contained in:
chrisndodge
2012-10-02 07:10:29 -07:00
3 changed files with 16 additions and 6 deletions

View File

@@ -14,10 +14,13 @@ class CMS.Views.ModuleEdit extends Backbone.View
$component_editor: => @$el.find('.component-editor')
loadModules: ->
@module = XModule.loadModule(@$el.find('.xmodule_edit'))
loadDisplay: ->
XModule.loadModule(@$el.find('.xmodule_display'))
loadEdit: ->
if !@module
@module = XModule.loadModule(@$el.find('.xmodule_edit'))
metadata: ->
# cdodge: package up metadata which is separated into a number of input fields
# there's probably a better way to do this, but at least this lets me continue to move onwards
@@ -44,7 +47,7 @@ class CMS.Views.ModuleEdit extends Backbone.View
render: ->
if @model.id
@$el.load("/preview_component/#{@model.id}", =>
@loadModules()
@loadDisplay()
@delegateEvents()
)
@@ -70,3 +73,4 @@ class CMS.Views.ModuleEdit extends Backbone.View
event.preventDefault()
@$el.addClass('editing')
@$component_editor().slideDown(150)
@loadEdit()