Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
433 views
in Technique[技术] by (71.8m points)

TinyMCE 5 custom button icon

How can I use the emoticons icon from the default TinyMCE buttons for my own custom button with TinyMCE version 5? With TinyMCE version 4 I could do it like this:

setup: function (editor) {
    editor.addButton('emoji', {
        icon: 'btn_emoji',
        tooltip: "Emoji",     
        onclick: function () {
            ... some actions ...
        }
    });
},  
question from:https://stackoverflow.com/questions/65891078/tinymce-5-custom-button-icon

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I have found the list of icon identifiers:

So the code is:

setup: function (editor) {
    editor.addButton('emoji', {
        icon: 'emoji',
        tooltip: "Emoji",     
        onAction: function () {
            ... some actions ...
        }
    });
}, 

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...