Index: core/admin_templates/forms/form_edit_emails.tpl =================================================================== --- core/admin_templates/forms/form_edit_emails.tpl +++ core/admin_templates/forms/form_edit_emails.tpl @@ -99,10 +99,11 @@ get_control($field_mask, $fields[$i]).disabled = !$enabled; } + $(get_control($field_mask, 'ReplyMessageSignature')).trigger('refresh'); get_control($field_mask, 'ProcessUnmatchedEmails', undefined, '_cb').disabled = !$enabled; } reflectFromFields(); - \ No newline at end of file + Index: core/admin_templates/js/forms.js =================================================================== --- core/admin_templates/js/forms.js +++ core/admin_templates/js/forms.js @@ -134,15 +134,27 @@ } if ( !$.isEmptyObject($CodeMirrorEditors) ) { - var $editor; - - for (var $editor_id in $CodeMirrorEditors) { - var $textarea_element = $('#' + jq($editor_id)), + $.each($CodeMirrorEditors, function ($editor_id, $editor_options) { + var $editor, + $textarea_element = $('#' + jq($editor_id)), $height = parseInt($textarea_element.height(), 10); - $editor = CodeMirror.fromTextArea($textarea_element.get(0), $CodeMirrorEditors[$editor_id]); + if ( $textarea_element.is(':disabled') ) { + $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' : ''); + }) + ; + }); } } Index: core/admin_templates/popups/editor.tpl =================================================================== --- core/admin_templates/popups/editor.tpl +++ core/admin_templates/popups/editor.tpl @@ -25,7 +25,10 @@ } if (!$opener.closed) { - $opener.document.getElementById($TargetField).value = CKEDITOR.instances['Content'].getData(); + $opener.$($opener.document.getElementById($TargetField)) + .val(CKEDITOR.instances['Content'].getData()) + .change() + ; } window_close(); @@ -86,4 +89,4 @@ - \ No newline at end of file +