[FIX] Empty Incoming webhook script field (#17422)

pull/17428/head
Guilherme Gazzo 6 years ago committed by GitHub
parent 7a2adb9192
commit da89b4cf9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      app/ui/client/lib/codeMirror/codeMirrorComponent.js

@ -16,6 +16,15 @@ Template.CodeMirror.onRendered(async function() {
const textarea = this.find('textarea');
const editor = CodeMirror.fromTextArea(textarea, options);
this.autorun((c) => {
const { code } = Template.currentData();
if (code === undefined) {
return;
}
c.stop();
editor.setValue(code);
});
CodeMirrors[this.data.id || 'code-mirror-textarea'] = editor;
if (this.data && this.data.editorOnBlur) {
this.data.editorOnBlur(this.data.name);

Loading…
Cancel
Save