mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-20 22:03:03 +08:00
Make tiny mce saving at clicking anywhere outside of the editor works only for task and protocol description
This commit is contained in:
parent
8e6413b031
commit
d761a5cecb
1 changed files with 10 additions and 7 deletions
17
app/assets/javascripts/sitewide/tiny_mce.js
vendored
17
app/assets/javascripts/sitewide/tiny_mce.js
vendored
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue