diff -u b/wysiwyg.module b/wysiwyg.module --- b/wysiwyg.module +++ b/wysiwyg.module @@ -341,9 +341,11 @@ // Check whether the editor requires an inline initialization script. if (!empty($editor['init callback'])) { // Request global variables from the editor. - $init = $editor['init callback']($editor, $library, $profile); - if (!empty($init)) { - drupal_add_js($init, array('type' => 'inline') + $default_library_options); + $init_script = $editor['init callback']($editor, $library, $profile); + if (!empty($init_script)) { + // ajax_render() ignores inline scripts. We work around that. + // @see wysiwyg_js_alter() + drupal_add_js($init_script, array('wysiwyg' => 'inline') + $default_library_options); } } @@ -412,6 +414,19 @@ } /** + * Implements hook_js_alter(). + * + * @see wysiwyg_load_editor() + */ +function wysiwyg_js_alter(&$items) { + foreach ($items as &$item) { + if (isset($item['wysiwyg'])) { + $item['type'] = 'inline'; + } + } +} + +/** * Add editor settings for a given input format. */ function wysiwyg_add_editor_settings($profile, $theme) {