crispconcepts / kirby-accordionHeadlineField

Replaces the default "headline" field, and groups all content until next "headline" field in an accordion
17 stars 3 forks source link

Kriby 2.2 update breaks accordions #6

Closed mearno closed 8 years ago

mearno commented 9 years ago

With the new panel structure in Kirby 2.2. the accordions won't work anymore. See screenshot.

schermafbeelding 2015-11-19 om 09 08 17

crispconcepts commented 8 years ago

This should be working now. Please let me know if you're still seeing any issue.

mearno commented 8 years ago

Thanks.

The first panel is opened by default so I did:

}); //.first().addClass('active').parent().next().addClass('active').slideDown(0);

Not sure if that has further consequences though but it seems to work :)

mearno commented 8 years ago

I also run into the following:

Inside a panel I use a structured field. When I add a new field and cancel, the headers stop working(won't open). (probably a js thing) When I close the page and open it again the headers work fine.

crispconcepts commented 8 years ago

Hmm, underneath the body element, there's a div class="main" that on ajax calls seems to get id="null" appended to it. On save, the id="null" goes away on it's own. On cancelling the structure id="null" remains.

To fix the on save issue, I wrapped the code in a function and triggered it again on ajaxSuccess. I tried doing the same on ajaxError and didn't work. I wonder i there's a deeper issue. I don't think I'll get to this for a little while as I'm very busy at work and with the holidays, but I will look into debugging it further (unless someone else wants to) and bringing any issues I find to bastian's attention.