在CK编辑器中使用类名称设置插件工具栏图标 [英] set plugin toolbar icon using class names in CK Editor

查看:238
本文介绍了在CK编辑器中使用类名称设置插件工具栏图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用类名(而不是使用图像URL)设置插件和/或小部件工具栏按钮图标?

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

推荐答案

我发现了一个看似明显缺少的功能的黑客程序:

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
});

已通过CK Editor v4.6.2测试

Tested with CK Editor v4.6.2

这篇关于在CK编辑器中使用类名称设置插件工具栏图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆