In CKEditor, how can I add a “text” label to a button?

前端 未结 4 1036
旧巷少年郎
旧巷少年郎 2021-02-05 15:19
editor.ui.addButton( \'ImageUpload\',{
                label: \'Upload Image\',
                command: \'popup_image_uploader\',
                icon: this.path + \'im         


        
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-05 15:54

    In the current ckeditor (4.6.x) the answers above do not work for me.

    I dug around in ckeditor/skins/moono-list/editor.css and did a search for "source" to find how they did the Source button which has text. I found this:

    .cke_button__source_label,
    .cke_button__sourcedialog_label
    {
        display:inline
    }
    

    Notice that there are TWO underscores here before the name of your custom button. When I tried with only one underscore it did not work.

    Anyway you would replace "source" or "sourcedialog" above with whatever you want and add that to your own css file.

    Additionally, it seems to only work for button names that are entirely lowercase.

提交回复
热议问题