Expose 'reply-open' and other similar events
What are you trying to do?
I need a way to tap into the events when a user clicks Reply etc and its resulting comment form is added/removed etc. I'm doing this so I can initialize my custom character count indicator UI for each field.
I believe this is an example of where Comments internally emits these types of events, but I can't seem to get access.
this.instance.emit('reply-open', { comment: this });
code reference
What's your proposed solution?
Emit the event in a global scope.
Additional context
Comments are render via AJAX on my posts and use:
craft.comments.getJsVariables
craft.comments.render
Users can access comments in multiple posts and add new comments and replies as usual. The trouble I'm having is specifically with the replies since that mark-up is injected dynamically. So while my character count indicator UI will show up, I don't have a good way to execute my JS for it to function.
We're actually just starting a major revamp of the front-end architecture for Comments, so we'll roll this, and many more extensibility changes in!
In the meantime, I'll see what I can do about emitting that.