1
我尝试在TinyMCE中创建一个自定义上下文菜单。TinyMCE 4.X:添加对齐选项到上下文菜单
contextmenu:"cut copy paste | alignment"
和“对齐”像
tinymce.PluginManager.add('context_menu',function(editor) {
editor.addMenuItem('alignment', {
text: 'Alignment',
menu:[{text: 'Left', icon: 'alignleft', cmd: 'alignleft'},
{text: 'Center', icon: 'aligncenter', cmd: 'aligncenter'},
{text: 'Right', icon: 'alignright', cmd: 'alignright'},
{text: 'Justify', icon: 'alignjustify', cmd: 'alignjustify'}],
context:'alignment'
});
});
代码给人以对齐选项的上下文菜单,但是当我的ALIGN单击左/右/辩解似乎没有任何working.The文本不对齐根据命令。我尝试了“cmd”和“格式”选项,但没有任何工作。