Skip to main content

Bug Tracker

Side navigation

#552 closed feature (fixed)

Opened December 21, 2006 12:56AM UTC

Closed January 17, 2007 12:24PM UTC

Last modified June 20, 2007 02:03AM UTC

ifxhighlight improved oldStyle.backgroundColor detection

Reported by: bluej100@gmail.com Owned by: stefan
Priority: minor Milestone:
Component: interface Version:
Keywords: highlight background color Cc:
Blocked by: Blocking:
Description

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.

Attachments (0)
Change History (7)

Changed December 21, 2006 04:32PM UTC by bluej100@gma comment:1

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', '');

}

Changed December 21, 2006 04:34PM UTC by bluej100@gma comment:2

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

Changed December 22, 2006 12:29AM UTC by bluej100@gma comment:3

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

Changed January 15, 2007 07:17AM UTC by stefan comment:4

resolution: → fixed
status: newclosed

Changed January 16, 2007 06:27PM UTC by bluej100@gma comment:5

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.

Changed January 17, 2007 12:24PM UTC by stefan comment:6

resolution: → fixed
status: reopenedclosed

Fixed and commited to svn

Changed January 22, 2007 09:00PM UTC by bluej100@gma comment:7

Thanks so much.