Thursday, 3 October 2013

Issue with tinyMCE init after loading content by ajax (IE7,8)

Issue with tinyMCE init after loading content by ajax (IE7,8)

I have a problem with initialization tinyMCE (Version 3.4.7 (2011-11-03))
in IE 7,8. It worked in all other browsers but has a problem in IE. The
problem manifested in the following:
I load content by Ajax and started tinyMCE initialization (after inserting
this content and dom ready event)
Edit text content in tinyMCE editor
Save or not save this content and load again this page content by Ajax and
init tinyMCE the same as first
tinyMCE inited fine but... all inputs and same ad tinyMCE are not
clickable and can't be focused.
My initialization of tinyMCE the next:
tinyMCE.init({
mode : "textareas",
//editor_selector : selector,
theme : "advanced",
plugins : "legacyoutput, paste",
width: 630,
theme_advanced_buttons1 : "link,unlink",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
force_br_newlines : false,
force_p_newlines : true,
convert_newlines_to_brs : true,
forced_root_block : false,
/*style cleaner*/
paste_auto_cleanup_on_paste : true,
paste_remove_styles: true,
paste_remove_styles_if_webkit: true,
paste_strip_class_attributes: true,
paste_text_sticky: true,
paste_as_text: true,
paste_text_sticky_default: true,
setup : function(ed) {
ed.onChange.add(function(ed, e) {
changed = true;
});
ed.onKeyUp.add(function(ed, e) {
changed = true;
});
}
});
If I tried to load the content without tinyMCE all works fine.
Also I tried to remove tinyMCE after loading as
tinyMCE.execCommand('mceRemoveControl', false, 'tiny_editor');
and init it again and it not helped.
On the first boot it also works. Can I kill it completely and
re-initialize ? or do you have any something else idea ?

No comments:

Post a Comment