Add properties to TinyMce after init()?

独自空忆成欢 提交于 2020-05-29 07:18:51

问题


Consider the initialization:

function initMyTinymce() {
    tinymce.init({
        selector: $(this).attr("id"),
        directionality: "ltr",
    });
}

Is it possible to add properties to tinyMCE after init()?

For example:

plugins: "link,code,textcolor",
relative_urls: false,
convert_urls: false,
remove_script_host: false

I'm using TinyMce 4.1.6 (2014-10-08).


回答1:


Yes, this is possible, but parameters that get red on initialisation only won't have an impact if they get set later on. Example: To change the parameter plugins changes nothing because the tinymce UI has been rendered already.

To set a paramter after initialization use:

editor.settings.my_setting = 'abcd',


来源:https://stackoverflow.com/questions/34437755/add-properties-to-tinymce-after-init

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!