切换工具栏按钮状态的最简单方法是什么(就像使用默认的粗体按钮一样)?我无法"获得"那个将我从默认变为选中的按钮外观的Tinymce.这是我的插件代码(简化):
tinymce.PluginManager.add('myplugin', function (editor) {
editor.addButton('mybutton', {
text: false,
image: 'someimage.png',
onclick: function () {
/* Toggle this toolbar button state to selected (like with the tinymce bold-button)*/
/* and of course some other code goes here */
}
});
});
Run Code Online (Sandbox Code Playgroud)