When using Activemenus with the Garland theme in IE6, the -/+ icons don't get applied, and more importantly, you can only collapse nodes, or expand nodes that you've previously collapsed, but you can't expand new nodes which is obviously the more useful feature of this module.
It shows the right cursors at all the right times though (hand over -/+, pointer otherwise).

Affected browsers: IE6
Not affected: Fx1.5, Fx2, Opera
Has its own (separately filed) issue: IE7

Affected themes: Garland
(though for other themes note also http://drupal.org/node/140620)

Comments

Jomel’s picture

Assigned: Unassigned » Jomel
Status: Active » Needs review
StatusFileSize
new676 bytes

Ok I've found the problem: In the click handler for collapsed nodes that haven't been loaded, you do this:

var offset = Drupal.mousePosition(e).x - Drupal.absolutePosition(this).x;
// Determine if we are in the selection area.
if (offset < (0 + parseInt($(this).css('padding-left')))) {

In most browsers, .css('padding-left') returns the computed value in pixels, however in IE returns it in its original format, so for the garland theme we get "1.5 em", which is parsed as 1 pixel, and is hence impossible to click.
I suggest just using a hardcoded value if .css('padding-left') isn't in pixels, like so:

var offset = Drupal.mousePosition(e).x - Drupal.absolutePosition(this).x;
var padding = $(this).css('padding-left');
// Determine if we are in the selection area.
if (offset < (padding.slice(-2) == "px" ? parseInt(padding) : 18)) {

Note that 18px is the actual value of .css('padding-left') when using the Garland theme, as well as being a reasonable default.
I've attached a patch which does exactly this. Please review/checkin the fix to the other IE7 issue, while you're at it: http://drupal.org/node/140622

For reference, I tried another approach that first tries to multiply em values by the font-size, but this in turn assumes that the font-size is in pixels, so probably isn't worth it (e.g. what if the font-size is "150%"!)

var offset = Drupal.mousePosition(e).x - Drupal.absolutePosition(this).x;
var padding = $(this).css('padding-left');
var multiplier = padding.slice(-2) == "em" ? parseInt($(this).css('font-size')) : 1;
padding = parseFloat(padding) * multiplier;
// Determine if we are in the selection area.
if (offset < (isNaN(padding) ? 18 : Math.max(padding, 18))) {

Accurately converting between css length values is horrific and requires inserting a hidden div to the DOM!

Jomel’s picture

Title: Activemenus + Garland in IE6 can only collapse nodes » Activemenus + Garland in IE can only collapse nodes

Forgot to mention I tested in Fx1.5, Fx2, IE6, IE7 and Opera9 (on Windows) in each of Garland, Pushbutton and Bluemarine and it works fine (with my patch to http://drupal.org/node/140622 and ignoring the existing bugs http://drupal.org/node/140620 and http://drupal.org/node/140585)

nedjo’s picture

Title: Activemenus + Garland in IE can only collapse nodes » Activemenus + Garland in IE6 can only collapse nodes

Thanks a lot Jomel for your work tracking down these tricky issues! Let me know if you end up getting Drupal CVS write access and want to help maintain activemenus or other jstools components. Meantime, I'll apply your patches as soon as I have a chance to test.

nedjo’s picture

Status: Needs review » Fixed

Applied, thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)