Anomaly - Preview Only Shows First Line in Safari 3?

Started by Vik_R, December 11, 2007, 12:43:58 PM

Previous topic - Next topic

Vik_R

I notice that in Safari 3, when I click the preview button for a new post, I only see the first line of my message.  For example, when I press Preview for this post, I only see...

QuoteI notice that when I click the preview button for a new post, I only see the first line of my message. For example, when I press Preview

---- Wait -- the whole post is there in the preview - you just have to click and drag to see it.

So, I guess I'm reporting an anomaly with SMF in Safari 3.

karlbenson

This has been reported a couple of times and Thantos added it to the bug tracker.
They believe the cause is Safari not correctly holding the contents of a <div>.

I believe some Safari users reported it to Apple.
Hopefully it a future version of SMF a workaround can be found.

gracion

#2
Here's a workaround for SMF 1.1.4. I've noticed Safari sometimes doesn't like mixing tables and CSS, so I redid the preview table as pure CSS.

in your Post.template.php (mine is based on Default), replace the preview section echo statement with this:
// If the user wants to see how their message looks - the preview DIV is where it's at!
echo '
<div id="preview_section"', isset($context['preview_message']) ? '' : ' style="display: none;"', '>
<div id="preview_subject" class="titlebg">', empty($context['preview_subject']) ? '' : $context['preview_subject'], '</div>
<div id="preview_body" class="windowbg">', empty($context['preview_message']) ? '' : $context['preview_message'], '</div>
</div>';


To your style.css, add these styles:
#preview_section {
border: 1px solid #adadad;
margin-bottom: 18px;
}

#preview_subject {
padding-top: 2px;
padding-bottom: 3px;
border-bottom: 2px solid #adadad;
}

#preview_body {
padding: 3px 3px 3px 4px;
}


Those border attributes are based on Default, so they may not match your particular theme. Only tested in Safari 3 and Camino 1.5.2. YMMV.

I only got started with SMI yesterday, so I may well be doing things wrong. For one thing, you might want to only present this with a browser check for Safari. Suggestions welcome.
[Edit: SMF version # and added right margin body padding]

Thantos

Quote from: karlbenson on December 11, 2007, 02:17:13 PM
This has been reported a couple of times and Thantos added it to the bug tracker.
They believe the cause is Safari not correctly holding the contents of a <div>.

I believe some Safari users reported it to Apple.
Hopefully it a future version of SMF a workaround can be found.

Indeed, I was able to fix it.

Advertisement: