Re: Trigger an event after running collapse.js

2020-12-04 Thread Adam Johnson
Rather than requiring changes to Django, I believe you can do this with a MutationObserver to detect the class attribute changing on the corresponding elements: https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver/observe . This has the advantage that we don't need to add custom events

Trigger an event after running collapse.js

2020-12-04 Thread Fab
When the admin's collapse script has finished it would be good to get an event I can listen to: https://github.com/django/django/blob/master/django/contrib/admin/static/admin/js/collapse.js This would be useful for custom scripts that rely on the collapse class and elements being in place. It wo