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