I installed the module and noticed that while the accordion was created fine in preview, it was messed up on the actual page. After some troubleshooting I found that the problem came from these lines in views-accordion.js:
// Wrap the accordion content within a div if necessary
if (!usegroupheader) {
$this.siblings().wrapAll('<div></div>');
}It seemed to me that the wrapping should be made IF a group header is used, not if it is not used. Therefore I tried removing the exclamation mark so that the code looked like this instead:
// Wrap the accordion content within a div if necessary
if (usegroupheader) {
$this.siblings().wrapAll('<div></div>');
}That fixed the problem for me.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | fix-accordion-view-on-page-1799838.patch | 460 bytes | dennismathenge |
Comments
Comment #1
manuel garcia commentedI've tested it and if you do use field grouping and have the setting Use the group header as the Accordion header on, then this change messes things up.
Can you provide the expor of the view so that we can troubleshoot this further?
Comment #2
dennismathenge commentedI found the problem to be in the module's javascript file. I have created the attached patch that fixed everything for me.
Comment #3
jacob.embree commenteddennismathenge uploaded the same patch to #1630730: Working in preview - don't working on site. It is not good to put the same patch on two issues. If they both do indeed need the same fix then one should be marked a duplicate of the other. I can't confirm that to be the case here.