Hello,
I''ve found that Effect.Highlight has a side effect - it sets
explicit background color on the highlighted element.
This is undesirable if initial backround color was set via CSS
class and this class is removed later, like in the following
example:
<style type="text/css">
.foo {background-color: green}
</style>
<div id="myId" class="foo">some text</div>
<script type="text/javascript">
new Effect.Highlight(''myId'', {
afterFinish: function() {
$(''myId'').removeClassName(''foo'');
// Now we have a problem:
background color was not reset and remains green
}
});
</script>
I have a simple fix for this problem: in file effects.js, replace
if (!this.options.restorecolor)
this.options.restorecolor = this.element.getStyle(''background-
color'');
with
if (!this.options.restorecolor)
this.options.restorecolor = this.element.style.backgroundColor
|| "";
In this case, final restore color will be either existing explicit
one, or will be unset (and will take default value according to other
CSS options).
What do you think?
Kind regards,
KIR
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---