This project is archived and is in readonly mode.

#341 ✓invalid

Element.highlight() end color

Reported by UloPe | August 28th, 2008 @ 12:01 PM | in 2.0 (closed)

The Element.highlight() function tries to "guess" the "end color" (the one to return to after highlighting) via getStyle('background-color').

Now if the element has "transparent" background white is assumed.

The following patch changes this so that the parent elements are also inspected for background color.

end = this.retrieve('highlight:original', this.getStyle('background-color'));
+ var p = this.getParent();
+ while (end == 'transparent' && p) {
+ 	end = p.getStyle('background-color');
+ 	p = p.getParent();
+ }
end = (end == 'transparent') ? '#fff' : end;

Comments and changes to this ticket

  • Tom Occhino

    Tom Occhino October 3rd, 2008 @ 05:51 AM

    • State changed from “new” to “invalid”
    • Tag changed from 1.2, enhancement, patch, trivial to enhancement, patch

    I think the performance hit is not worth the benefit. Since you can optionally pass the end color as a second parameter, I think this solution is a little unnecessary. Thanks for the patch though...

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket