prevent console errors when code mirror parses invalid syntax

This commit is contained in:
Keith Grant
2019-04-01 08:16:11 -04:00
parent 7b16931658
commit 95f5315fa3

View File

@@ -17,10 +17,12 @@ function atCodeMirrorModalController (
} else if ($scope.disabled === 'false') { } else if ($scope.disabled === 'false') {
$scope.disabled = false; $scope.disabled = false;
} }
const editor = $(`${CodeMirrorModalID} .CodeMirror`)[0].CodeMirror; const editor = $(`${CodeMirrorModalID} .CodeMirror`)[0];
const height = $(ModalHeight).height() - $(ModalHeader).height() - if (editor) {
$(ModalFooter).height() - 100; const height = $(ModalHeight).height() - $(ModalHeader).height() -
editor.setSize('100%', height); $(ModalFooter).height() - 100;
editor.CodeMirror.setSize('100%', height);
}
} }
function toggle () { function toggle () {