mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #3322 from tractorcow/pulls/3.1/tinymce-config
API Let update interval of tinymce be changed or disabled
This commit is contained in:
commit
f7a9005a8e
@ -73,6 +73,7 @@ class HtmlEditorConfig {
|
||||
'editor_selector' => "htmleditor",
|
||||
'width' => "100%",
|
||||
'auto_resize' => false,
|
||||
'update_interval' => 5000, // Ensure update of this data every 5 seconds to the underlying textarea
|
||||
'theme' => "advanced",
|
||||
|
||||
'theme_advanced_layout_manager' => "SimpleLayout",
|
||||
|
@ -89,6 +89,7 @@ ss.editorWrappers.tinyMCE = (function() {
|
||||
// after an (undetected) inline change. This "blur" causes onChange
|
||||
// to trigger, which will change the button markup to show "alternative" styles,
|
||||
// effectively cancelling the original click event.
|
||||
if(ed.settings.update_interval) {
|
||||
var interval;
|
||||
jQuery(ed.getBody()).on('focus', function() {
|
||||
interval = setInterval(function() {
|
||||
@ -98,11 +99,12 @@ ss.editorWrappers.tinyMCE = (function() {
|
||||
// Set content without triggering editor content cleanup
|
||||
element.val(ed.getContent({format : 'raw', no_events : 1}));
|
||||
}
|
||||
}, 5000);
|
||||
}, ed.settings.update_interval);
|
||||
});
|
||||
jQuery(ed.getBody()).on('blur', function() {
|
||||
clearInterval(interval);
|
||||
});
|
||||
}
|
||||
});
|
||||
this.instance.onChange.add(function(ed, l) {
|
||||
// Update underlying textarea on every change, so external handlers
|
||||
|
Loading…
Reference in New Issue
Block a user