根据选择切换ckeditor插件菜单按钮状态的正确方法是什么?
例如,在链接/取消链接插件中,我只想在光标位于链接中时启用取消链接.
editor.addCommand("unlink", {
exec: function (editor) {
//do something here
},
refresh: function (editor, path) {
// never seems to get fired. Is this even the right hook?
}
});
editor.ui.addButton("Unlink", {
label: "Unlink",
command: "unlink"
});
Run Code Online (Sandbox Code Playgroud)
谢谢您的帮助!