MyBB Community Forums

Full Version: 1.6.x - Fixing Message Editor (Relative Size)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I know there is a similar tutorial but mine us using a different approach.

In this case the message editor will always fill the box it is in. Meaning it will go all the way to the right end of the container. This even works when the theme uses different sizes there.

First you will have to edit jscripts/editor.js

Comment out the lines:
171-175, 196, 258,267
Just write // at the start of each of those.

You will need to add this to the global.css

.messageEditor{
margin:0px;
padding:4px;
}

#message_new{
margin:0px;
padding:4px;
height: 313px !important;
width: 99%;
}

And you are done Wink

Hope this helps.
Hi Tatsuto, thanks for the tutorial

just a tip: it would be better if you show the lines instead of their number, since a lot of people (including me) have the editor.js already modified, and the lines won't match
It comes down to commenting out any line and syntax that mentioned width.

Cannot be copied as whole. This is a shortened version of the orginal file and cannot be used as is! Only for finding the lines that I commented out.
		// Determine the overall height and width - messy, but works
		//w = oldTextarea.getDimensions().width+"px";
		//if(!w || parseInt(w) < 400)
		//{
		//	w = "400px";
		//}
		if(this.options && this.options.height)
		{
			h = this.options.height;
		}
		else if(oldTextarea.offsetHeight)
		{
			h = oldTextarea.offsetHeight+"px";
		}
		else if(oldTextarea.clientHeight)
		{
			h = oldTextarea.clientHeight+"px";
		}
		else if(oldTextarea.style.height)
		{
			h = oldTextarea.style.height;
		}
		else
		{
			h = "400px";
		}
		//this.editor.style.width = w;
		this.editor.style.height = h;

		// Set the width/height of the area
		subtract = 20;
		subtract2 = 8;
		areaContainer.style.height = parseInt(Element.getDimensions(this.editor).height)-this.toolbarHeight-subtract+"px";
		//areaContainer.style.width = parseInt(Element.getDimensions(this.editor).width)-subtract2+"px";

		// Create text area
		textInput = document.createElement("textarea");
		textInput.setAttribute("cols", oldTextarea.getAttribute("cols"));
		textInput.setAttribute("rows", oldTextarea.getAttribute("rows"));
		textInput.id = this.textarea;
		textInput.name = oldTextarea.name+"_new";
		textInput.style.height = parseInt(areaContainer.style.height)+"px";
		//textInput.style.width = parseInt(areaContainer.style.width)+"px";