Make tiny mce saving at clicking anywhere outside of the editor works only for task and protocol description

This commit is contained in:
Mojca Lorber 2019-05-10 11:27:47 +02:00
parent 8e6413b031
commit d761a5cecb

View file

@ -158,14 +158,17 @@ var TinyMCE = (function() {
} }
} }
// Saving at clicking anywhere outside of the editor // Saving at clicking anywhere outside of the editor ("inline style")
editor.on('blur', function(event) { editor.on('blur', function(event) {
event.preventDefault(); if (this.id === 'my_module_description_textarea'
editorForm.clearFormErrors(); || this.id === 'protocol_description_textarea') {
editor.setProgressState(1); event.preventDefault();
editor.save(); editorForm.clearFormErrors();
editorForm.submit(); editor.setProgressState(1);
updateScrollPosition(); editor.save();
editorForm.submit();
updateScrollPosition();
}
}); });
// Init Save button // Init Save button