set plugin toolbar icon using class names in CK Ed

2019-09-16 14:44发布

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

1条回答
\"骚年 ilove
2楼-- · 2019-09-16 15:26

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

查看更多
登录 后发表回答