A
A
Al-ex2017-07-13 20:09:21
PHP
Al-ex, 2017-07-13 20:09:21

How to make compact font and font size change button in Tinymce 4?

Hello! In the Tinymce 4 editor, by default, changing the font and font size is done in the drop-down list as HERE . It is not very compact, especially takes up a lot of space on mobile phones. How to make icons instead of a drop-down list, like the rest of the blocks? Found on a third party forum and took screenshots for clarity. I did the initialization like this:

plugins: [
                "advlist autolink lists link image preview anchor responsivefilemanager",
                "code fullscreen save textcolor colorpicker charmap nonbreaking",
                "insertdatetime media table contextmenu paste imagetools stylebuttons"
            ],
            toolbar_items_size : 'small',
            menubar:'edit insert format table',
            toolbar1: "undo redo | fontselect fontsizeselect forecolor backcolor | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist | link unlink image media | removeformat fullscreen code",

Pasting fontsize into toolbar doesn't work. Maybe a plugin is needed?
Screenshots of what you need here, I saw on the forum.
f0dcfa26fda94eceae75c47013fe6e41.jpg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Yanyshev, 2017-07-14
@villiwalla

Make a separate button for each size, or use a self-made plug-in that will open a modal with a choice of font size and apply it to the selected area. Documentation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question