mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-21 22:33:13 +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) {
|
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
|
||||||
|
|
Loading…
Reference in a new issue