Fixes #604 where code editor has been forcibly removed

This commit is contained in:
Sam Georges 2014-09-10 07:25:11 +10:00
parent e9923d000f
commit 44cff23009
1 changed files with 3 additions and 2 deletions

View File

@ -439,12 +439,13 @@
function addTokenExpanderToEditor(pane, $form) {
var group = $('[data-field-name=markup]', pane),
editor = $('[data-control=codeeditor]', group),
toolbar = editor.codeEditor('getToolbar'),
canExpand = false
if (editor.data('oc.tokenexpander'))
if (!editor.length || editor.data('oc.tokenexpander'))
return
var toolbar = editor.codeEditor('getToolbar')
editor.tokenExpander()
var breakButton = $('<li />').prop({ 'class': 'tokenexpander-button' }).append(