Make WordPress Core

Changeset 49191


Ignore:
Timestamp:
10/18/2020 05:09:46 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Comments: Hide the link to the initial parent comment in the reply heading when replying to another comment.

This ensures that the reply heading is updated correctly on single post URLs with the ?replytocom query argument.

Follow-up to [47506], [48876], [48904].

Props mailnew2ster, wpamitkumar, audrasjb, desrosj, SergeyBiryukov.
Merges [49187] to the 5.5 branch.
Fixes #51175.

Location:
branches/5.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.5

  • branches/5.5/src/js/_enqueues/lib/comment-reply.js

    r48917 r49191  
    179179        var replyHeadingElement  = getElementById( config.commentReplyTitleId );
    180180        var replyHeadingTextNode = replyHeadingElement && replyHeadingElement.firstChild;
     181        var replyLinkToParent    = replyHeadingTextNode && replyHeadingTextNode.nextSibling;
    181182
    182183        if ( replyHeadingTextNode && replyHeadingTextNode.nodeType === Node.TEXT_NODE && headingText ) {
     184            if ( replyLinkToParent && 'A' === replyLinkToParent.nodeName && replyLinkToParent.id !== config.cancelReplyId ) {
     185                replyLinkToParent.style.display = '';
     186            }
     187
    183188            replyHeadingTextNode.textContent = headingText;
    184189        }
     
    320325        var replyHeading         = getElementById( config.commentReplyTitleId );
    321326        var replyHeadingTextNode = replyHeading && replyHeading.firstChild;
     327        var replyLinkToParent    = replyHeadingTextNode && replyHeadingTextNode.nextSibling;
    322328
    323329        if ( ! addBelowElement || ! respondElement || ! parentIdField ) {
     
    343349
    344350        if ( replyHeadingTextNode && replyHeadingTextNode.nodeType === Node.TEXT_NODE ) {
     351            if ( replyLinkToParent && 'A' === replyLinkToParent.nodeName && replyLinkToParent.id !== config.cancelReplyId ) {
     352                replyLinkToParent.style.display = 'none';
     353            }
     354
    345355            replyHeadingTextNode.textContent = replyTo;
    346356        }
Note: See TracChangeset for help on using the changeset viewer.