When you have sub taxonomy lists and you click on parent item, the entire taxonomy collapses. For example:

  • Term a
  • Term b
    • Term b1
    • Term b2 <-- When I'm clicked, Term b collapses
      • Term b2.1
      • Term b2.2
    • term b3
  • Term c

This is due to event propagation. All that needs to be done is adding e.stopPropagation() to the functions bound to the $expansibles list in the javascript file.

For example:

      // Collapse list
      .bind('collapse', function() {
        var $item = $(this),
            $child = $item.children('div.item-list').children('ul');
        $child.slideUp('fast');
        $item
          .removeClass('expanded')
          .addClass('collapsed');
      })

Needs to be:

      // Collapse list
      .bind('collapse', function(e) {
        e.stopPropagation();
        var $item = $(this),
            $child = $item.children('div.item-list').children('ul');
        $child.slideUp('fast');
        $item
          .removeClass('expanded')
          .addClass('collapsed');
      })

Comments

danillonunes’s picture

When I'm clicked, Term b collapses

Did you want to say term b2 collapses?

If yes, that is the desired behavior. I do that for consistency, since when it collapsed you can expand it by clicking in any place on it, so clicking again will collapse it. But I'm accept suggestions of better behaviors.

If you really mean that b collapses, then it's a strange bug that I could not reproduce here. So please send me more details about your installation and browser used to test.

meramo’s picture

Same problem. I'm choosing b, then b2 (going to choose b2.1), then accidentally b collapses and I had to open it again to complete my selection. This is very annoying. Chrome 11 and FF4 under Windows 7, Garland theme.

Apart from that, the module is super great, thanks for your work!

danillonunes’s picture

Testing with Chrome on Mac/Win, I cannot reproduce yet :(

Igor, can you confirm that change suggested by onedotover can make it works?

meramo’s picture

I can confirm the bug on all browsers under Win7. The solution onedotover suggested didn't work for me. Asking my collegues to do a massive test under all available systems and browsers, will provide more info later.

meramo’s picture

MacOS users confirmed the bug, so it's weird...

zerolab’s picture

Confirming the bug.
In our case, the fix builds on top of onedotover's fix, adding event.stopPropagation() to all binded events.

zerolab’s picture

Attaching patch as well.

nunoveloso’s picture

Status: Active » Reviewed & tested by the community

zerolab patch working and tested.

danillonunes’s picture

Status: Reviewed & tested by the community » Fixed

Commited for the next release.

Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.