rviscomi/trunk8

Trunk8 cutting text to late

simonferndriger opened this issue · 8 comments

Example:
http://www.lookr.com/de/lookout/1357752542-S%C3%B6renberg

Below "Marbach LU", the description is empty, because the text is NOT cut, therefore it is too long and gets hidden because of the css "overflow:hidden".

SAME results when using an additional "span" element for the target text.

image

Can you double check the timing of your $.trunk8() calls, to make sure that this isn't an issue of trunk8ing text in one font, then substituting it with a bigger web font?

OK, sure. Please tell me again how I can check properly?

Put a breakpoint in your code when you trunk8 and check the font of the text. I looked at your source and couldn't find where you call trunk8().

OK, trunk8() gets called 2 times. First on document.ready (where the new font seems not to be loaded fully yet), then again on window.load. See attachment.

Does this mean, that I only are allowed to call trink8 once on window.load here?

First call (document.ready):
first_call

Second call (window.load):
second_call

I now tried an alternative version in which I execute trunk8 only ONCE and AFTER the font is fully loaded.
SAME result.

onwindowload

The other thing that could be affecting it is the "11km" part. When is that text set? Is it possible that the text is truncated to the full line then the km is inserted?

OK, good idea. But no. The text is generated directly via PHP and is there from the very beginning. Sorry.
Any other options?

Sorry I can't think of anything else. For filing bugs against trunk8 you should show what part of the trunk8 code is broken. So I would suggest stepping through the code to find out why it isn't working as expected, and if you find it you can either report it here in this issue or file a pull request.