I don't know why but when I have a view_accordion with another view_accordion embedded in the footer of the first view, then the second (embedded) view_accordion won't work.

Not passing the headerSelector seems to solve the problem, although I don't get why. The headerSelectors themselves seem correct to me.

However this problem is occurring on a server which deploys via drush make, so I need this patch, even if it is not the correct solution.

If anyone knows the actual problem, please update this issue.

Comments

Sneakyvv’s picture

Sneakyvv’s picture

Status: Active » Needs review
Sneakyvv’s picture

I've found the actual problem. The jQuery selector (the JS variable displaySelector) is not specific enough in my case, since my view is embedding another view. The second view is also being targeted by the selector ".view-content", which apparently screws up the "inner"-accordion.

So I updated my patch. Now the css selector contains " > .view-content", so only the direct children are targeted.

Sneakyvv’s picture

Title: Mulitple view accordions don't work due to headerSelector » Multiple / embedded view accordions don't work
Sneakyvv’s picture

StatusFileSize
new597 bytes

Gave the patch a more appropriate name

manuel garcia’s picture

StatusFileSize
new604 bytes

The patch seems to make sense.

Rerolled against the latest dev and committed with attribution. Thanks Sneakyvv!

manuel garcia’s picture

Version: 7.x-1.0-rc2 » 7.x-1.x-dev
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

brankoc’s picture

This patch breaks views that use custom templates where .view-content is not the immediate child of view-display-id-x. Just FYI, in case you get questions about why someone's accordion no longer works.

narkoff’s picture

I have a view with two embedded views in the footer. The embedded views use accordions. I was having an issue with accordions breaking when performing certain actions. One consistently identified was clearing a search facet (Search API and Facetapi). I reverted the patch in this issue and it resolved the problem. Not sure why, but just an FYI. @brankoc comment lead me to try reverting the patch. Thanks.