1 . open a new page
if( CKEDITOR.instances[element_id] )
# it will delete the CKEDITOR old instance from cache but it won't remove the CKEDITOR DOM
(Because the new page has no CKEDITOR DOM, so we needn't destroy it, just use remove. If you use destroy method, it will produce a bug! )
CKEDITOR.remove(CKEDITOR.instances[element_id]) ;
CKEDITOR.replace(element_id, options)
2. create a ckeditor and destroy it in one page
CKEDITOR.replace(element_id, options)
CK EDITOR .instances[element_id]) .destroy() # it will remove the CKEDITOR DOM
3. In Chrome
When you use ckeditor in chrome, you should remember create ckeditor after box resized.
1) create a ckedtior in a new popup window
you should run the create ckeditor code on popup window event : on_complete
CK_Reload = function() {if (CKEDITOR.instances['#{element_id}']) { |
I run CK_Reload in on_complete event.
2) re-create a ckeditor in popup window
you should run the re-create ckeditor code after popup window resized.
_ error.js.erb
var content = ''; |
3) If you use box resize method:
4. In firefox
1) If you use box resize method: