Changeset View
Changeset View
Standalone View
Standalone View
branches/5.3.x/core/admin_templates/js/forms.js
Show First 20 Lines • Show All 128 Lines • ▼ Show 20 Line(s) | |||||
} | } | ||||
// process all CodePress instances | // process all CodePress instances | ||||
if ($.isFunction(window.CodePress)) { | if ($.isFunction(window.CodePress)) { | ||||
CodePress.run(/*FCKeditor_OnComplete*/); | CodePress.run(/*FCKeditor_OnComplete*/); | ||||
} | } | ||||
if ( !$.isEmptyObject($CodeMirrorEditors) ) { | if ( !$.isEmptyObject($CodeMirrorEditors) ) { | ||||
var $editor; | $.each($CodeMirrorEditors, function ($editor_id, $editor_options) { | ||||
var $editor, | |||||
for (var $editor_id in $CodeMirrorEditors) { | $textarea_element = $('#' + jq($editor_id)), | ||||
var $textarea_element = $('#' + jq($editor_id)), | |||||
$height = parseInt($textarea_element.height(), 10); | $height = parseInt($textarea_element.height(), 10); | ||||
$editor = CodeMirror.fromTextArea($textarea_element.get(0), $CodeMirrorEditors[$editor_id]); | if ( $textarea_element.is(':disabled') ) { | ||||
$editor.setSize(null, $height); | $editor_options.readOnly = 'nocursor'; | ||||
} | } | ||||
$editor = CodeMirror.fromTextArea($textarea_element.get(0), $editor_options); | |||||
$editor.setSize(null, $height); | |||||
$textarea_element | |||||
.on('change', function ($e) { | |||||
$editor.getDoc().setValue($textarea_element.val()); | |||||
}) | |||||
.on('refresh', function ($e) { | |||||
$editor.setOption('readOnly', $textarea_element.is(':disabled') ? 'nocursor' : ''); | |||||
}) | |||||
; | |||||
}); | |||||
} | } | ||||
} | } | ||||
function Form() {} | function Form() {} | ||||
Form = new Form(); | Form = new Form(); | ||||
Form.Controls = new Array(); | Form.Controls = new Array(); | ||||
▲ Show 20 Lines • Show All 286 Lines • Show Last 20 Lines |