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) {
event.preventDefault();
editorForm.clearFormErrors();
editor.setProgressState(1);
editor.save();
editorForm.submit();
updateScrollPosition();
if (this.id === 'my_module_description_textarea'
|| this.id === 'protocol_description_textarea') {
event.preventDefault();
editorForm.clearFormErrors();
editor.setProgressState(1);
editor.save();
editorForm.submit();
updateScrollPosition();
}
});
// Init Save button