I believe I have found a bug in the Morph function. I was trying to
call it like this:
Morph(document.body, {"style": {"backgroundColor":
backgroundColor}});
So the visual effect would fade the background color to the given
color. The strange thing is that certain hex color codes would not
work and would give me an exception.
The format of color numbers where like this: #996666
The issue was that any hex color ending in a zero would cause this
MochiKit condition to be true:
if(MochiKit.Visual.CSS_LENGTH.test(_677))
Which would then try to parse the number as a float and there is where
the exception would be generated. I found that if i changed this line:
MochiKit.Visual.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|
mm|pt|pc|\%))|0$/;
to this:
MochiKit.Visual.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|
mm|pt|pc|\%))$/;
The condition above would be false and Morph would work on hex color
codes ending with a zero.
Most likely there is a reason why the "OR 0" was added to the end of
this regex so I would not say that this is a fix for all people but I
wanted to bring it to your attention so that the regex can be adjusted
properly. I was having trouble finding a place to post this bug so I
posted it here.
Thanks,
Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" 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/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---