Collapsible Forum Categories

Using collapsible categories in another extension - Collapsible Forum Categories

Using collapsible categories in another extension

by javiexin » Mon Aug 14, 2017 1:25 pm

Hello,

I have followed the wiki article on integrating Collapsible Categories in other extensions, and I must say that it was easy, and quick to do.

However, I have a situation where I cannot make it work completely. The issue is with JavaScript code in both extensions: both use the same block to show/hide and do other things, and they step on each other. In fact, CC is stepping on the other things to do.

The specific case: if the container is collapsed at page start, then the initialization of the other library does not work (it is the jQuery Lazy Load library) because it uses the current show/hide state to initialize itself. Also, I have some filters applied in that container, via dropdowns in the same page, that "onchange" dynamically show/hide elements within the container, so if you change them when hidden, on open they are not correct: there should be a refresh of that as well.

So, I would need a way to hook into the show/hide events (JS) of the CC extension, so that I can integrate the other JavaScript properly. And there is where I have failed completely. I have tried to replace the ajax callback with an "extended" version (that would call the current plus new functionality), tried putting other JS events in different elements, but all ended up in no success.

Any help would be much appreciated! Thanks a lot,
-javiexin
User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact: