TinyMCE 4 - remove() or destroy()

后端 未结 15 687
抹茶落季
抹茶落季 2020-12-25 12:22

I am using TinyMCE editor. I want to remove or destroy tinymce editors (Page contain more then one editor). Also remove classes and IDs added by tinyMCE.

Bu

15条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-25 12:36

    Bear in mind that if given textarea has an id, tinyMCE will use it for some strange reason, even if selector parameter has been used to apply editor to given element. This id is then used in internal array - tinyMCE.editors which isn't cleared (isn't cleared if you'll use tinymce.execCommand('mceRemoveControl', true, [id]), remove actually removes editors and prevents tinyMCE to be applied ever again). As such if you have a dynamic content with tinyMCE applied, it will work once, but never again. To resolve this you need to clean this array manually per delete tinyMCE.editors[$(node).getAttribute('id')]

提交回复
热议问题