[wp-trac] [WordPress Trac] #47306: comment reply event listener: need ability to run custom js function
WordPress Trac
noreply at wordpress.org
Fri May 24 23:52:26 UTC 2019
#47306: comment reply event listener: need ability to run custom js function
-------------------------+----------------------
Reporter: jnorell | Owner: (none)
Type: enhancement | Status: closed
Priority: normal | Milestone:
Component: Comments | Version: 5.1
Severity: normal | Resolution: invalid
Keywords: | Focuses:
-------------------------+----------------------
Comment (by jnorell):
Replying to [comment:2 jnorell]:
> Replying to [comment:1 peterwilsoncc]:
> > If I am misunderstanding your needs, please let me know and I will
keep this ticket open until I hear back from you.
>
> I'll give that a go and reply here with the outcome.
>
I did use this approach (overwriting moveForm()) which works for clicking
on a Reply link, but a problem still remains in handling the cancel reply
link - addComment.cancelEvent() moves #comment as well, so ideally it
would be nice to be able to overwrite it as well, which is not currently
possible.
As a workaround, I rename the wp-temp-form-div element so cancelEvent
exits without doing anything, and I attach an inline onclick handler for
the cancel link to do the real work. That works so that comment-tweaks
can add the editor with 5.1+ again.
I'll submit a simple patch (if I can to a closed issue) to allow
overwriting clickEvent and cancelEvent functions, maybe consider it.
Thanks much!
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47306#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list