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

pull/17454/head
Guilherme Gazzo 6 years ago committed by Diego Sampaio
parent 9bd843039a
commit e4ef21cac5
No known key found for this signature in database
GPG Key ID: E060152B30502562
  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