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 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
Comment #1
danillonunes commentedDid 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.
Comment #2
meramo commentedSame 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!
Comment #3
danillonunes commentedTesting with Chrome on Mac/Win, I cannot reproduce yet :(
Igor, can you confirm that change suggested by onedotover can make it works?
Comment #4
meramo commentedI 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.
Comment #5
meramo commentedMacOS users confirmed the bug, so it's weird...
Comment #6
zerolab commentedConfirming the bug.
In our case, the fix builds on top of onedotover's fix, adding
event.stopPropagation()to all binded events.Comment #7
zerolab commentedAttaching patch as well.
Comment #8
nunoveloso commentedzerolab patch working and tested.
Comment #9
danillonunes commentedCommited for the next release.
Thanks.