The Highlight effect must modify the style, but there should be an
option to restore any modified style after completion. Actually, there
is an undocumented "restoreAfterFinish" flag for the Scale effect that
does just that.

Perhaps what we should do is to add support for such a flag to all the
base effect classes. Or have another look at all the various
"afterFinishInternal" in the code that seem to cause a lot of code
replication (also indicating that the current API is far from
perfect).

Cheers,

/Per

On Tue, Aug 26, 2008 at 5:13 PM, Christoph Zwerschke <[EMAIL PROTECTED]> wrote:
>
> When I highlight an input field using MochiKit.Visual.Highlight, its
> background-color and background-image will be reset to "white" and
> "none". The problem is, when the input field had no style at all, it
> used the default browser style, which looks different.
>
> It's probably best to show this using the interactive JavaScript
> interpreter demo of MochiKit. Enter the following commands:
>
> a=INPUT(); b=INPUT();
> writeln(FORM(null, a, b)); Highlight(a);
>
> The left input field will be highlighted,
> and after that, it will look different from the right one.
>
> The following is even more obvious:
>
> a=INPUT({readonly:true}); b=INPUT({readonly:true});
> writeln(FORM(null, a, b)); Highlight(a);
>
> It seems I can reset the style like this:
>
> s = a.style; s.backgroundColor = s.backgroundImage = '';
>
> Unfortunately, it does still not redraw automatically, the old style
> will only come back when I hover over the input field with the mouse.
>
> Has anybody an idea how to properly reset the style or even improve the
> Highlight function in MochiKit so that it does not change the style?
>
> -- Christoph
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to