TinyMCE - Can you adjust the height of the editor below 100 pixels?

I am not so familiar with TinyMCE, but I cannot configure it with a height below 100 pixels. I tried and it seems to always set it as 100px anytime. I only need a few buttons, and the editor window probably never goes beyond a single line, so I'm trying to reduce a bit of interface clutter.

+7
javascript tinymce wysiwyg
source share
5 answers

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

tinyMCE.init({ ..., setup: function(editor) { editor.onInit.add(function() { var width = editor.getWin().clientWidth; var height = 50; editor.theme.resizeTo(width, height); }); } }); 
+4
source share

In version 4.XX, tinymce is where many changes have been made. Work 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'; }); }, ..., }); 
+5
source share

In 3.5.4, theme.resizeTo does not seem to work. It did the trick for me.

 tinyMCE.init({ ..., ed.onInit.add(function() { var id = ed.id; var height = 50; document.getElementById(id + '_ifr').style.height = height + 'px'; //One line with buttons takes roughly 30px, so we add that document.getElementById(id + '_tbl').style.height = (height + 30) + 'px'; }); }); 
+4
source share

With TinyMCE 3.5.2 you can use the min_height setting.

+2
source share
+1
source share

All Articles