simple-expand icon indicating copy to clipboard operation
simple-expand copied to clipboard

Callbacks?

Open jo-snips opened this issue 11 years ago • 2 comments

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

jo-snips avatar Sep 02 '13 19:09 jo-snips

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

sylvain-hamel avatar Sep 06 '13 21:09 sylvain-hamel

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

sylvain-hamel avatar Nov 15 '13 06:11 sylvain-hamel