Merge "Make reply links more robust so Google Translate won't break us"

This commit is contained in:
jenkins-bot 2021-10-05 13:53:03 +00:00 committed by Gerrit Code Review
commit 1a67ab6d74

View file

@ -50,7 +50,13 @@ ReplyLinksController.prototype.onReplyLinkClick = function ( e ) {
}
e.preventDefault();
this.emit( 'link-click', $( e.target ).data( 'mw-comment' ).id, $( e.target ) );
// Browser plugins (such as Google Translate) may add extra tags inside
// the link, so find the containing link tag with the data we need.
var $link = $( e.target ).closest( 'a[data-mw-comment]' );
if ( !$link.length ) {
return;
}
this.emit( 'link-click', $link.data( 'mw-comment' ).id, $link );
};
ReplyLinksController.prototype.onAddSectionLinkClick = function ( e ) {