Cleanup TinyMCE on Outcomes pages if it exists
Test Plan: - On the outcomes page, switch between two or more outcomes and observe that there are no JS errors (undefined type error) - edit an outcome, but click on a different outcome befor clicking either the cancel or submit buttons. Observe no JS errors - edit an outcome. Click cancel and then select a different outcome. Observe no JS errors Fixes CNVS-16825 Change-Id: I748b3e40b6e64eec78aa9c8ae2bd7eb708211486 Reviewed-on: https://gerrit.instructure.com/44283 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Simon Williams <simon@instructure.com> QA-Review: Adam Stone <astone@instructure.com> Product-Review: Benjamin Porter <bporter@instructure.com>
This commit is contained in:
parent
05226c8092
commit
aae40142f8
|
@ -121,6 +121,7 @@ define [
|
|||
@$('form').toJSON()
|
||||
|
||||
remove: ->
|
||||
@_cleanUpTiny() if @tinymceExists()
|
||||
@$el.hideErrors()
|
||||
@model.destroy() if @state is 'add' and @model.isNew()
|
||||
super arguments...
|
||||
|
@ -178,7 +179,7 @@ define [
|
|||
# Called from subclasses in render.
|
||||
readyForm: ->
|
||||
setTimeout =>
|
||||
@$('textarea').editorBox() # tinymce
|
||||
@$('textarea').editorBox() # tinymce initializer
|
||||
@setupTinyMCEViewSwitcher()
|
||||
@addTinyMCEKeyboardShortcuts()
|
||||
@$('input:first').focus()
|
||||
|
@ -188,3 +189,6 @@ define [
|
|||
|
||||
updateTitle: (e) =>
|
||||
@model.set 'title', e.currentTarget.value
|
||||
|
||||
tinymceExists: =>
|
||||
return @$el.find('[name="description"]').length > 0 and @$el.find('[name="description"]').editorBox('exists?')
|
||||
|
|
Loading…
Reference in New Issue