How to use fontAwesome icons in TextEditor

Hi.
TextEditor only allows to use f7 and material icons. You can also use fontAwesome icons with customized buttons. The trick is to copy the f7 code for the execCommand. Here is an simple example.

var textEditor = app.textEditor.create({
	el: '.text-editor',
	customButtons: {
		fa_p: { content:"<i class='fas fa-paragraph'></i>", onClick(event, buttonEl) { document.execCommand('formatBlock', false, 'p'); }},
	},
	buttons : [ ['fa_p'] ],
	value : "some text"
});
2 Likes