Hi!
I believe I've found a solution to a "pending" fix.
-=ET=- wrote:
asinshesq wrote:And here's another issue:
In firefox (and presumably mozilla) the posting screen jumps up to the top if you insert a smilie in a post that is long enough so that you have scroll bars and are inserting a smilie or bbcode towards the bottom. That does not happen with IE.
Any easy fix for that?
Unfortunately, not yet

OPEN:
posting_body.tpl and
posting_smilies.tpl
FIND:
Code: Select all
function mozInsert(txtarea, openTag, closeTag)
{
AFTER ADD:
Code: Select all
var scrollTop = ( typeof(txtarea.scrollTop) == 'number' ? txtarea.scrollTop : -1 );
FIND (at the end of the mozInsert function):
AFTER ADD:
Code: Select all
if( scrollTop >= 0 ) { txtarea.scrollTop = scrollTop; }
So, the whole mozInsert function looks like this:
Code: Select all
function mozInsert(txtarea, openTag, closeTag)
{
var scrollTop = ( typeof(txtarea.scrollTop) == 'number' ? txtarea.scrollTop : -1 );
if (txtarea.selectionEnd > txtarea.value.length) { txtarea.selectionEnd = txtarea.value.length; }
var startPos = txtarea.selectionStart;
var endPos = txtarea.selectionEnd+openTag.length;
txtarea.value=txtarea.value.slice(0,startPos)+openTag+txtarea.value.slice(startPos);
txtarea.value=txtarea.value.slice(0,endPos)+closeTag+txtarea.value.slice(endPos);
txtarea.selectionStart = startPos+openTag.length;
txtarea.selectionEnd = endPos;
txtarea.focus();
if( scrollTop >= 0 ) { txtarea.scrollTop = scrollTop; }
}
Tested on Firefox 1.0.4 and seems to work.
