Posted by e5sego on October 24, 2012 at 8:19pm
2 followers
Jump to:
| Project: | CKEditor - WYSIWYG HTML editor |
| Version: | 7.x-1.x-dev |
| Component: | Documentation |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
I use code suggested by http://drupal.org/node/1145132#comment-5601364 to disable autoload of ckeditor on few textareas.
But after adding new entity to the form via ajax (>Add new item< button) on all textarea the ckeditor get enabled, which causes the browser to hang for seconds on big forms. Any idea how to solve this?
Also if certain ckeditor are disabled vie the >Switch to plain text editor< link they will get re-enabled after adding new item to the form via ajax.
Comments
#1
Thank you for noticing this. We try check and fix this as soon as possible.
#2
Remark:
setting the autostart values to false or 'undefined' using hook_js_alter() does not disable ckeditor autostart. Just removing them does it, with the behavior descriped above.
jQuery.extend(Drupal.settings, (...) "autostart":{"edit-field-somefield-und-0-value":false} (...) )PHP-alternative to disable ckeditor on each field with machine name starting with "somefield":
<?phpfunction mymodule_js_alter(&$js) {
foreach($js['settings']['data'] as &$item) {
if (isset($item['ckeditor']['autostart'])) {
list($field, $val) = each($item['ckeditor']['autostart']);
if (strpos($field, 'edit-field-somefield') !== false) {
//$item['ckeditor']['autostart'][$field] = false; /* don't work */'
unset($item['ckeditor']['autostart']);
}
}
}
}
?>
#3
@e5sego,
thank you for information and code sample.