繁体   English   中英

如何使用CKEditor将新按钮添加到组中

[英]How can I add a new button into a group with CKEditor

我正在使用以下配置:

config.toolbarGroups = [
        { name: 'document', groups: ['mode', 'document', 'doctools', 'maximize'] },
        { name: 'clipboard',   groups: [ 'clipboard', 'undo' ] },
        { name: 'editing',     groups: [ 'find', 'selection', 'spellchecker' ] },
        { name: 'forms' },
        { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
        { name: 'paragraph',   groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'justify' ] },
        // { name: 'links' },
        { name: 'insert' },
        { name: 'styles' },
        { name: 'colors' },
        { name: 'tools' },
        { name: 'others' }
        // ,
        //{ name: 'about' }
    ];

    // The default plugins included in the basic setup define some buttons that
    // we don't want too have in a basic editor. We remove them here.
    // config.removeButtons = 'Cut,Copy,Paste,Undo,Redo,Anchor,Underline,Strike,Subscript,Superscript';
    config.removeButtons = 'Strike,Subscript,Superscript';

    // Let's have it basic on dialogs as well.
    config.removeDialogTabs = 'link:advanced';

    config.extraPlugins = 'insertpre,format,justify,maximize';

一切正常,但是最大化按钮始终位于工具栏的第二行。 有什么办法可以使最大化组合与其他其他按钮(例如insertpre按钮)相邻?

您必须逐项配置工具栏以控制每个按钮的确切位置。 默认情况下,Maximize属于tools组,因此您也可以将整个组放在工具栏的顶部,如下所示:

config.toolbarGroups = [
        { name: 'document', groups: [ 'tools', 'mode', 'document', 'doctools', 'maximize'] },
        ...
];

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM