Commit 55542c1d by Calen Pennington

Make editor display immediately, and with a white background

parent 2accc779
...@@ -14,10 +14,13 @@ class CMS.Views.ModuleEdit extends Backbone.View ...@@ -14,10 +14,13 @@ class CMS.Views.ModuleEdit extends Backbone.View
$component_editor: => @$el.find('.component-editor') $component_editor: => @$el.find('.component-editor')
loadModules: -> loadDisplay: ->
@module = XModule.loadModule(@$el.find('.xmodule_edit'))
XModule.loadModule(@$el.find('.xmodule_display')) XModule.loadModule(@$el.find('.xmodule_display'))
loadEdit: ->
if !@module
@module = XModule.loadModule(@$el.find('.xmodule_edit'))
metadata: -> metadata: ->
# cdodge: package up metadata which is separated into a number of input fields # 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 # 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 ...@@ -45,7 +48,7 @@ class CMS.Views.ModuleEdit extends Backbone.View
render: -> render: ->
if @model.id if @model.id
@$el.load("/preview_component/#{@model.id}", => @$el.load("/preview_component/#{@model.id}", =>
@loadModules() @loadDisplay()
@delegateEvents() @delegateEvents()
) )
...@@ -71,3 +74,4 @@ class CMS.Views.ModuleEdit extends Backbone.View ...@@ -71,3 +74,4 @@ class CMS.Views.ModuleEdit extends Backbone.View
event.preventDefault() event.preventDefault()
@$el.addClass('editing') @$el.addClass('editing')
@$component_editor().slideDown(150) @$component_editor().slideDown(150)
@loadEdit()
...@@ -228,6 +228,10 @@ ...@@ -228,6 +228,10 @@
border-radius: 0 0 3px 3px; border-radius: 0 0 3px 3px;
background: -webkit-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, .1)) $blue; background: -webkit-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, .1)) $blue;
.module-editor {
background: white;
}
h5 { h5 {
margin-bottom: 8px; margin-bottom: 8px;
color: #fff; color: #fff;
......
...@@ -5,7 +5,9 @@ ${preview} ...@@ -5,7 +5,9 @@ ${preview}
</div> </div>
<a href="#" class="drag-handle wip"></a> <a href="#" class="drag-handle wip"></a>
<div class="component-editor"> <div class="component-editor">
${editor} <div class="module-editor">
${editor}
</div>
<a href="#" class="save-button">Save</a> <a href="#" class="save-button">Save</a>
<a href="#" class="cancel-button">Cancel</a> <a href="#" class="cancel-button">Cancel</a>
</div> </div>
......
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