set plugin toolbar icon using class names in CK Editor

。_饼干妹妹 提交于 2019-12-12 02:14:42

问题


How do I set plugin and/or widget toolbar button icon using class names (instead of using image URL)?


回答1:


I've found a hack for this seemingly obvious missing feature:

editor.ui.addButton('MyButton', {
    //className: '...' // this only adds the classes to the parent container, not the icon span
    icon: '_ fa fa-scissors _'  // this hacks the existing classes and injects extra classes to the icon span
});

Tested with CK Editor v4.6.2



来源:https://stackoverflow.com/questions/41620593/set-plugin-toolbar-icon-using-class-names-in-ck-editor

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