simple-expand
simple-expand copied to clipboard
Callbacks?
Hi there,
Thanks much for the script! Is there any way to execute a callback or to trigger another action once something has been expanded?
Thanks, Jonah
Hi,
No, but it would be fairly easy to support. I'll try to find some time to do it in the upcoming weeks. Or you can send me a PR (including the fix and unit tests) and I'll merge it.
Sylvain
I checked the code. Would it fit you requirement if you could subscrive to an expand-state-changed
event like this?
$("#myexpander").on("expand-state-changed", function (event, newState) {
console.log(newState);
});
To support that, all I have to do is to add this line of code at line 229
expander.trigger("expand-state-changed", isExpanded);
Let me know if that is what you are looking for.
Thanks