don't include file preview when editing syllabus body

test plan:
* create a syllabus description that references a
 file that can be previewed in-line
* save the syllabus and refresh page
* while viewing the syllabus preview the link in-line
* click to edit the syllabus (while the preview is open)
* confirm that the file preview html is not included
 in the editor html

fixes #CNVS-5976

Change-Id: I2ecbdc69b1df5c9f012509b0f6fa2109361493aa
Reviewed-on: https://gerrit.instructure.com/20880
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
This commit is contained in:
James Williams 2013-05-23 12:39:08 -06:00
parent 691c6be9a6
commit 80fd695001
2 changed files with 5 additions and 1 deletions

View File

@ -163,13 +163,15 @@ define [
$course_syllabus = $('#course_syllabus')
$course_syllabus_details = $('#course_syllabus_details')
$course_syllabus.data('syllabus_body', ENV.SYLLABUS_BODY)
wikiSidebar and wikiSidebar.init()
$edit_course_syllabus_form.on 'edit', ->
$edit_course_syllabus_form.show()
$course_syllabus.hide()
$course_syllabus_details.hide()
$course_syllabus_body.editorBox()
$course_syllabus_body.editorBox 'set_code', $course_syllabus.html()
$course_syllabus_body.editorBox 'set_code', $course_syllabus.data('syllabus_body')
if wikiSidebar
wikiSidebar.attachToEditor $course_syllabus_body
wikiSidebar.show()
@ -210,6 +212,7 @@ define [
success: (data) ->
$course_syllabus.loadingImage('remove').html data.course.syllabus_body
$course_syllabus.data('syllabus_body', data.course.syllabus_body)
$course_syllabus_details.hide()
error: (data) ->

View File

@ -1,4 +1,5 @@
<% js_env :CAN_READ => can_do(@context, @current_user, :read) %>
<% js_env :SYLLABUS_BODY => user_content(@syllabus_body) %>
<% @active_tab = "syllabus" %>
<% course_home ||= false %>
<% if !course_home %>