I have some custom buttons that I want the text of each button to be different. However, the style option sets the style to a div, not a button, so it doesn't work.
Here is my code for creating a button
editor.addButton('rank', {
text: 'Rank',
tooltip: 'Highlight Rank',
icon: false,
style:'color:red;',
onPostRender: function () {
var button = this;
editor.on('NodeChange', function (e) {
if (editor.formatter.match('rank')) {
button.active(true);
} else {
button.active(false);
}
});
},
Here is the html output
<div id="mceu_0" class="mce-widget mce-btn mce-btn-small mce-first mce-last" tabindex="-1" aria-labelledby="mceu_0" style="color: red;" role="button" aria-label="Highlight Rank" aria-pressed="false">
<button role="presentation" type="button" tabindex="-1" >Rank</button></div>
Can someone tell me the correct option to apply the style to the button? I need to style each button differently.
source
share