MyBB Community Forums

Full Version: Auto expanding SCeditor
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I would like SCeditor to expand on its own, instead scrolling in a window when text gets too long. 
It seems SCeditor provides an option for that; from their website:

Quote:height
height String or int Defaults to 
null

Initial height of the editor. Can be either an int which will be treated as the px value or a string percentage. e.g. 
"100%"

.

If set to null the height will be set the height of the textarea it is replacing.

and

Quote:autoExpand
autoExpand bool Defaults to 
false

If to auto expand the editor to fit the content

so I tried adding these options to the codebutton template

opt_editor = {
	plugins: "bbcode,undo",
	style: "{$mybb->asset_url}/jscripts/sceditor/textarea_styles/jquery.sceditor.{$theme['editortheme']}?ver=1808",
	rtl: {$lang->settings['rtl']},
	locale: "mybblang",
	enablePasteFiltering: true,
	autoUpdate: true,
	emoticonsEnabled: {$emoticons_enabled},
	emoticons: {
		// Emoticons to be included in the dropdown
		dropdown: {
			{$dropdownsmilies}
		},
		// Emoticons to be included in the more section
		more: {
			{$moresmilies}
		},
		// Emoticons that are not shown in the dropdown but will still be converted. Can be used for things like aliases
		hidden: {
			{$hiddensmilies}
		}
	},
	emoticonsCompat: true,
	toolbar: "{$basic1}{$align}{$font}{$size}{$color}{$removeformat}{$basic2}image,{$email}{$link}|video{$emoticon}|{$list}{$code}quote|maximize,source",

		height: "100%",
		autoExpand: true,
};

But that didn't help either.


I also tinkered for hours with the height of the textarea that gets replaced by SCeditor and tried using jquery plugins to resize the iframe, but just couldn't figure it out.

It would be awesome if someone who knows more than me can give me a hint!  Lightbulb



Edit: I noticed the editor is in fact expanding when pressing enter but what I want is that it appears expanded to the size of the content when editing.
Have you find the solution?