Reviewed & tested by the community
Project:
Views Nested Accordion
Version:
7.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Nov 2014 at 06:56 UTC
Updated:
10 Jul 2017 at 05:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ideafarm commentedhi hmartens, did you ever solve this?
Comment #2
hollyfox commentedWhat is happening here? I have just integrated this module into an extensive development project and it seems to work just fine except for this. I will root around in the module code to see if I can locate the issue. I suspect that it is an issue with this module not passing the object to the Views Accordion module, but we'll see.
If anyone (maintiner?) has any ideas it would be appreciated. solving this little nusance problem would really round out this module.
Thanks.
Comment #3
hollyfox commentedOK, here is a quck fix that still has an issue. First, the issue is that the options for the child content are not being applied to the nested-accordian class so they only affect the child groupings so the header groupings fall back to the jQuery accordian default of the first row being open. This can be set with the active: false statement, however, I have not figured out how to add this statement to the group heading yet. I am pretty new with javascript so it could take some time and I have other issues to resolve.
In the meantime, changing line 35 of the views_nested_accordian.css file rolls the group content up. However, the js selector thinks the row is open so it need to be clicked twice to open it. all other rows act normally.
Maybe this will help get to the resolution of the problem. If I get more time down the road I may take the time to play with it some more. I need to determine how the nested-accordian class is altering the original views-accordion class first though.
Happy Drupaling!
Comment #4
TheRealDeal commentedI am experiencing this bug also. I am a novice myself but would like to try and look into it, thanks hollyfox for making a start.
Comment #5
TheRealDeal commentedI found a quick little workaround for now, as well as commenting out line 35 of views_nested_accordian.css, comment out line 16 of views-nested-accordion.js which adds the nested-accordion class to the group header on page load.
This stops the js from thinking that the first header is initially open so that you don't need to double click, but the trade off is that obviously you can no longer set accordions to open by default on page load.
Comment #6
tommyk commentedInspired by the quick fix in comment #5, attached is a patch that uses
:only-childinstead of:first-childso that the group is expanded only if it is the only grouped set.This module currently hard codes the first child to be open always. The patch hard codes only single groups to be open and all groups to be closed when there are multiple.
Ideally the module would have options for initial page load behavior like the Views Accordion module does, but the patch is here as an alternative until one of us gets time to figure out how to make options work.
Comment #7
c13l0 commentedTested and verified patch #6 is working beautiful.
Comment #8
c13l0 commentedComment #9
kunalkursija commented#6 works nice and clean. Thanks for the quick fix.