[IE7] Categories list drop-down does not work in Internet Explorer

VERIFIED FIXED in 3.2

Status

VERIFIED FIXED
11 years ago
3 years ago

People

(Reporter: bugzilla-mozilla-20000923, Assigned: fligtar)

Tracking

x86
Windows Vista

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
If you browse a category or search, you get a "Categories" header in the top-left. When clicked, it should expand to show a list of categories below it. This doesn't work in Internet Explorer 7 (haven't tested 6).
(Reporter)

Comment 1

11 years ago
Just a little note, in case it is useful: the "Other Applications" drop-down works fine in IE7.

Comment 2

11 years ago
Stephen could you please try to reproduce this? Thanks!
Yes, I can confirm :-(
Assignee: nobody → craigcook.bugz
Target Milestone: --- → 3.2
Assignee: craigcook.bugz → nobody
This needs some more advanced JS debugging.
My JS debugger hates me... fligtar do you have a js debugger working for IE7?
Assignee: nobody → fligtar
(Reporter)

Comment 6

11 years ago
This is a good one - but I have found out what's going on. In:
    $(document).ready(function() {
        $("#categories.collapsed h3").click(function() { 
            $(document).click(function(e) {
...we have the code that closes the categories if you click outside of it. However, in IE, e.target.offsetParent (what the code checks) is the <H3> element (since e.target is the <SPAN> around the text). This means that the same click that expands the drop-down then closes it upon bubbling up to the document element.

My proposed fix is to replace the if (...) check in the inner-most click handler with the following code:

    var node = e.target;
    while (node && !node.id) {
        node = node.offsetParent;
    }
    if (!node || (node.id != 'categories' && node.id != 'cat-list')) {

This should keep things working in Firefox and other browsers where e.target is the <H3> here, and also make it work in IE where e.target is the <SPAN>, by working up the tree until it finds an ID.
(Assignee)

Comment 7

11 years ago
Created attachment 310051 [details] [diff] [review]
patch as checked in

I tested Silver's pseudo-patch and it works in IE7 and actually fixed a minor bug Firefox was having too, so I also used it for the Other Apps dropdown.
(Assignee)

Updated

11 years ago
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
Verified FIXED using both IE 6 and IE 7 on https://preview.addons.mozilla.org, as well as Safari 3.0.4/Opera 9.25, and of course Firefox 2/3.
Status: RESOLVED → VERIFIED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.