mleden wrote:
> Hi,
>
> This one was driving me nuts. Not sure how prevalent, but I have a
> very simple test case that shows at least one occasion where this
> causes a problem in Exhibit.
>
> Consider the following:
> <div ex:content=".label" class="exhibit-lens-title"></div>
> <div ex:content=".label" class="exhibit-lens-title">
> </div>
>
> Based on the principle that white-space in markup should not affect
> rendering, I would expect both to render identically. Not so...at
> least not in FF 3.0 on WinXP. On that client, the first renders
> correctly while the second does not.
>
> Or am I missing something obvious here?
>
This could be considered a bug in the lens template parsing code. What's
happening here is that when you use ex:content, then if that HTML
element has any child, the children are used as a sub-template for the
various values that the ex:content expression evaluates to. (Since the
sub-template is a whitespace string, each value gets rendered as
whitespace and you see nothing.) Right now the parsing code doesn't
treat the case of only white-space specially, and that's a bug.
The problem is in
http://api.simile-widgets.org/exhibit/2.2.0/scripts/ui/lens.js
Find
Exhibit.Lens._processTemplateElement
At the end of that function there's an if statement
if (childNode != null)
You can fix the problem by checking that childNode has no nextSibling
and that childNode is a text node with only whitespace.
David
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SIMILE Widgets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/simile-widgets?hl=en
-~----------~----~----~----~------~----~------~--~---