簡體   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