diff --git a/cms/static/coffee/src/views/module_edit.coffee b/cms/static/coffee/src/views/module_edit.coffee index 3116dfbb55..a96a1bbb81 100644 --- a/cms/static/coffee/src/views/module_edit.coffee +++ b/cms/static/coffee/src/views/module_edit.coffee @@ -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 @@ -45,7 +48,7 @@ class CMS.Views.ModuleEdit extends Backbone.View render: -> if @model.id @$el.load("/preview_component/#{@model.id}", => - @loadModules() + @loadDisplay() @delegateEvents() ) @@ -71,3 +74,4 @@ class CMS.Views.ModuleEdit extends Backbone.View event.preventDefault() @$el.addClass('editing') @$component_editor().slideDown(150) + @loadEdit() diff --git a/cms/static/sass/_unit.scss b/cms/static/sass/_unit.scss index 4546835811..e12313b877 100644 --- a/cms/static/sass/_unit.scss +++ b/cms/static/sass/_unit.scss @@ -228,6 +228,10 @@ border-radius: 0 0 3px 3px; background: -webkit-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, .1)) $blue; + .module-editor { + background: white; + } + h5 { margin-bottom: 8px; color: #fff; diff --git a/cms/templates/component.html b/cms/templates/component.html index 13b06a2ccc..86fe6e2bdb 100644 --- a/cms/templates/component.html +++ b/cms/templates/component.html @@ -5,7 +5,9 @@ ${preview}
- ${editor} +
+ ${editor} +
Save Cancel