Bug Tracker

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#552 closed feature (fixed)

ifxhighlight improved oldStyle.backgroundColor detection

Reported by: [email protected] Owned by: stefan
Priority: minor Milestone:
Component: interface Version:
Keywords: highlight background color Cc:
Blocked by: Blocking:


Interface's Highlight component currently has no effect unless the element it's applied to has an explicitly set background color. It would be nice if, when none is set, it traversed up the tree to find an element which did have a set background color, then removed background color completely when the effect was done.

Change History (7)

comment:1 Changed 16 years ago by [email protected]

I recommend that this be inserted at line 36, after the declaration of z.oldStyle:

if (!z.oldStyle.backgroundColor
z.oldStyle.backgroundColor == 'transparent') {

z.oldStyle.transparent = true; var tempParent = e.parentNode; var tempBG; while (tempParent) {

tempBG = jQuery(tempParent).css('backgroundColor'); if (tempBG && tempBG != 'transparent') {

z.oldStyle.backgroundColor = tempBG; break;

} if (tempParent.nodeName == 'BODY') {

z.oldStyle.backgroundColor = '#fff'; break;

} tempParent = tempParent.parentNode;



To remove the old style, insert this at what is now line 87:

if (z.oldStyle.transparent) {

z.el.css('backgroundColor', );


comment:2 Changed 16 years ago by [email protected]

The formatter screwed up the line breaks. I can send the actual code if you like.

comment:3 Changed 16 years ago by [email protected]

Upon further testing, even that solution screws things up if the background color has been applied by a class which is later removed.

comment:4 Changed 16 years ago by stefan

Resolution: fixed
Status: newclosed

comment:5 Changed 16 years ago by [email protected]

Resolution: fixed
Status: closedreopened

Thanks for your work on this. It's doing a great job removing the style rules when the effect finishes. However, I think it would be very useful if this iterated up the tree to determine the effective background color. It looks funny when you have a background color set for the page and it changes from yellow to white, then snaps back to transparent.

comment:6 Changed 16 years ago by stefan

Resolution: fixed
Status: reopenedclosed

Fixed and commited to svn

comment:7 Changed 16 years ago by [email protected]

Thanks so much.

Note: See TracTickets for help on using tickets.