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」和「格式」選項,但沒有任何工作。