Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tinyMCE - Can you configure an editor height below 100px?

I am not all that familiar with TinyMCE, but I cannot seem to configure it with a height below 100px. I've tried and it seems to always set it as 100px any time it goes below. I only need a few of the buttons and the editor window will likely never go beyond one line, so I am trying to reduce a bit of interface clutter.

like image 706
rr. Avatar asked Oct 19 '10 20:10

rr.


People also ask

How do I resize TinyMCE?

Clicking and dragging the resize handle in the bottom right-hand corner of the editor.

How do I get rid of powered by tiny?

Use the branding option to disable the “Powered by Tiny” link displayed in the status bar for product attribution.

How do I get rid of the status bar on TinyMCE?

statusbar. This option allows you to specify whether or not TinyMCE should display the status bar at the bottom of the editor. To disable the status bar, the statusbar option should be provided with a boolean false value.


2 Answers

In Version 4.X.X of tinymce there where a lot of changes made. Working code:

tinyMCE.init({
...,
setup: function (ed) {
    ed.on('init', function(args) {
        var id = ed.id;
        var height = 25;

        document.getElementById(id + '_ifr').style.height = height + 'px';
        document.getElementById(id + '_tbl').style.height = (height + 30) + 'px';
    });
},
...,
});
like image 94
Flummiboy Avatar answered Sep 18 '22 12:09

Flummiboy


After digging around a bit, it seems that you cannot configure the editor directly with a height below 100px. There is a workaround using the editor init callback to manually set the height. See http://tinymce.moxiecode.com/punbb/viewtopic.php?id=10015 for details.

tinyMCE.init({
    ...,
    setup: function(editor) {
        editor.onInit.add(function() {
            var width = editor.getWin().clientWidth;
            var height = 50;

            editor.theme.resizeTo(width, height);
        });
    }
});
like image 29
rr. Avatar answered Sep 17 '22 12:09

rr.