There's a strange issue with the editor vertical scrollbar in Safari. See attachment.
When the page is loaded, the scrollbar height is half of the editor window. As soon as I click into the editor, it adjusts itself to the right height.
It seems to me that the issue is independent from the editor's content (which, by the way, is properly formatted).
This happens with FCK 2.6.4 and Safari 4 beta (it also happens on the latest Safari 3.x though).
Everything's fine with Firefox, IE and Chrome.
When the page is loaded, the scrollbar height is half of the editor window. As soon as I click into the editor, it adjusts itself to the right height.
It seems to me that the issue is independent from the editor's content (which, by the way, is properly formatted).
This happens with FCK 2.6.4 and Safari 4 beta (it also happens on the latest Safari 3.x though).
Everything's fine with Firefox, IE and Chrome.

Re: Vertical scrollbar height in Safari
bob
Re: Vertical scrollbar height in Safari
DJ
Re: Vertical scrollbar height in Safari
Anyone know how to fix this?
Re: Vertical scrollbar height in Safari
Re: Vertical scrollbar height in Safari
Thanks,
Kapil
Re: Vertical scrollbar height in Safari
Some help would be great.
Thanks
Re: Vertical scrollbar height in Safari
From the context of the page including the FCK editor instance, you can run the following JavaScript:
<script> document.getElementById('editor___Frame').contentDocument.getElementById('xEditingArea').style.height = '100.1%'; setTimeout(function() { document.getElementById('editor___Frame').contentDocument.getElementById('xEditingArea').style.height = '100%' }, 100); </script>This code should run after the FCK editor has finished loading. To execute it automatically after FCK is initialized, define the following function:
<script> function FCKeditor_OnComplete( editorInstance ) { var fck_iframe = document.getElementById('editor___Frame'); var fck_editing_area = fck_iframe.contentDocument.getElementById('xEditingArea'); fck_editing_area.style.height = '100.1%'; setTimeout(function() {fck_editing_area.style.height = '100%'}, 100); } </script>This works for our site with a single FCK instance, but we haven't extensively tested it -- depending on your installation, it's possible that the iframe ID or the timeout might have to be adjusted. But until someone comes up with a proper solution, the workaround might hopefully be of use to some people.
Re: Vertical scrollbar height in Safari
Thanks a lot.
PD: I have to remove the ; in the middle of two lines because it was generating an error.
Re: Vertical scrollbar height in Safari
Great! Thanks for catching the typo -- I fixed the first code sample.
Re: Vertical scrollbar height in Safari
// Run this now for most browsers as of Chrome 2 and Safari 4 probs //if ( FCKBrowserInfo.IsGecko && !FCKBrowserInfo.IsOpera ) if ( !FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsOpera ) { window.onresize = function( e ) { // Running in Chrome makes the window receive the event including subframes. // we care only about this window. Ticket #1642. // #2002: The originalTarget from the event can be the current document, the window, or the editing area. if ( e && e.originalTarget !== document && e.originalTarget !== window && (!e.originalTarget.ownerDocument || e.originalTarget.ownerDocument != document )) return ; var oCell = document.getElementById( 'xEditingArea' ) ; var eInnerElement = oCell.firstChild ; if ( eInnerElement ) { eInnerElement.style.height = '0px' ; eInnerElement.style.height = ( oCell.scrollHeight - 2 ) + 'px' ; } } }Re: Vertical scrollbar height in Safari
Re: Vertical scrollbar height in Safari
When I add this:
if ( !FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsOpera )...
Windows chrome fails to launch edit window completely.
When I add:
if ( FCKBrowserInfo.IsGecko && !FCKBrowserInfo.IsOpera || FCKBrowserInfo.IsMac==true && FCKBrowserInfo.IsSafari || !FCKBrowserInfo.IsMac==true && FCKBrowserInfo.IsSafari)...
Windows chrome fails, Mac safari loads the content without a bad render of the content. Windows safaris works.
I think chrome identifies or is identified by fckeditor as IsSafari... So any fix for safari seems to be breaking chrome on Windows.
So I end up with this logic on the window render issue - bad luck safari on windows users.
if ( FCKBrowserInfo.IsGecko && !FCKBrowserInfo.IsOpera || FCKBrowserInfo.IsMac==true && FCKBrowserInfo.IsSafari)
The only problem now is that when safari 4 starts up an editor for the first time - it is not active so can not type until either view source and return, or reload window - it is really weird...
Any more ideas?
Re: Vertical scrollbar height in Safari
I can't seem to get this to work on mac browser... but the other one is partial fix.
//if ( !FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsOpera )
if ( FCKBrowserInfo.IsGecko && !FCKBrowserInfo.IsOpera || FCKBrowserInfo.IsMac==true && FCKBrowserInfo.IsSafari)
{
.....
Re: Vertical scrollbar height in Safari
function FCKeditor_OnComplete( editorInstance ) { var fck_iframe = document.getElementById(editorInstance.Name+'___Frame'); alert(fck_iframe); var fck_editing_area = fck_iframe.contentDocument.getElementById('xEditingArea'); fck_editing_area.style.height = '100.1%'; setTimeout(function() {fck_editing_area.style.height = '100%'}, 100); }Thanks for the tip.
Re: Vertical scrollbar height in Safari
From what I can tell we will probably have to live with it in Safari and chrome.
There is always one browser that breaks huh...
Re: Vertical scrollbar height in Safari
This problem persists for OS X Safari. and Chrome.
Re: Vertical scrollbar height in Safari
Re: Vertical scrollbar height in Safari
I guess as more people move to safari and chrome we will get a helping hand on the fix. It appears to be a platform issue for me when it comes to the helpful fixes, I can get windows safari to work but not both (windows / OS X) due to chrome bug having same issue.
btw: the fckeditor.net/demo shows the bug in safari for me...
Re: Vertical scrollbar height in Safari
I have had this page bookmarked and came here today after such a long time. Finally, to my satisfaction the above code also works for me.
Thanks a lot guys!
Re: Vertical scrollbar height in Safari
Re: Vertical scrollbar height in Safari
Does it work for you on OSX + Windows? And what file did you insert this code to?
Re: Vertical scrollbar height in Safari
Re: Vertical scrollbar height in Safari
I have been having the same problem on chrome, so thanks for the solution. However I found that while the proposed change to fckeditor.html fixed the problem, it then caused a similar problem to appear when they collapsed the toolbar.
You therefore also need to make the following change to fcktoolbarset.js
FCKToolbarSet.prototype._ChangeVisibility = function( collapse )
{
this._Document.getElementById( 'xCollapsed' ).style.display = collapse ? '' : 'none' ;
this._Document.getElementById( 'xExpanded' ).style.display = collapse ? 'none' : '' ;
// Run this now for most browsers as of Chrome 2 and Safari 4 probs (see also change to fckeditor.html)
//if ( FCKBrowserInfo.IsGecko )
if ( !FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsOpera )
{
// I had to use "setTimeout" because Gecko was not responding in a right
// way when calling window.onresize() directly.
FCKTools.RunFunction( window.onresize ) ;
}
}
Hope this helps ...