Dont try to load CodeMirror on non-existent DOM element

This commit is contained in:
Riyyi
2021-03-03 19:56:36 +01:00
parent a8056b66cc
commit 6f81c3472e
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -104,13 +104,13 @@ $(document).ready(function() {
// Enable CodeMirror Editor
$.fn.codeMirror = function() {
if (this.length === 0) return;
editor = CodeMirror.fromTextArea($(this)[0], editorOptions);
editor.setSize('100%', '500');
registerEditorCopy();
return editor;
}
$('textarea#syntax-code').codeMirror().setOption('mode', 'text/x-csrc');
$('textarea#syntax-code').codeMirror();
// Enable WYSIWYG Editor
$('textarea#summernote').summernote({