diff --git a/wp-includes/js/comment-reply.js b/wp-includes/js/comment-reply.js index 9e4b77d31d..5d20672058 100644 --- a/wp-includes/js/comment-reply.js +++ b/wp-includes/js/comment-reply.js @@ -178,8 +178,13 @@ window.addComment = ( function( window ) { var replyHeadingElement = getElementById( config.commentReplyTitleId ); var replyHeadingTextNode = replyHeadingElement && replyHeadingElement.firstChild; + var replyLinkToParent = replyHeadingTextNode && replyHeadingTextNode.nextSibling; if ( replyHeadingTextNode && replyHeadingTextNode.nodeType === Node.TEXT_NODE && headingText ) { + if ( replyLinkToParent && 'A' === replyLinkToParent.nodeName && replyLinkToParent.id !== config.cancelReplyId ) { + replyLinkToParent.style.display = ''; + } + replyHeadingTextNode.textContent = headingText; } @@ -319,6 +324,7 @@ window.addComment = ( function( window ) { var replyHeading = getElementById( config.commentReplyTitleId ); var replyHeadingTextNode = replyHeading && replyHeading.firstChild; + var replyLinkToParent = replyHeadingTextNode && replyHeadingTextNode.nextSibling; if ( ! addBelowElement || ! respondElement || ! parentIdField ) { // Missing key elements, fail. @@ -342,6 +348,10 @@ window.addComment = ( function( window ) { addBelowElement.parentNode.insertBefore( respondElement, addBelowElement.nextSibling ); if ( replyHeadingTextNode && replyHeadingTextNode.nodeType === Node.TEXT_NODE ) { + if ( replyLinkToParent && 'A' === replyLinkToParent.nodeName && replyLinkToParent.id !== config.cancelReplyId ) { + replyLinkToParent.style.display = 'none'; + } + replyHeadingTextNode.textContent = replyTo; } diff --git a/wp-includes/js/comment-reply.min.js b/wp-includes/js/comment-reply.min.js index 8c5475821c..cb4c954e2c 100644 --- a/wp-includes/js/comment-reply.min.js +++ b/wp-includes/js/comment-reply.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -window.addComment=function(p){var f,v,I,C=p.document,h={commentReplyClass:"comment-reply-link",commentReplyTitleId:"reply-title",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=p.MutationObserver||p.WebKitMutationObserver||p.MozMutationObserver,i="querySelector"in C&&"addEventListener"in p,n=!!C.documentElement.dataset;function t(){r(),function(){if(!e)return;new e(o).observe(C.body,{childList:!0,subtree:!0})}()}function r(e){if(i&&(f=E(h.cancelReplyId),v=E(h.commentFormId),f)){f.addEventListener("touchstart",l),f.addEventListener("click",l);var t=function(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode)return v.removeEventListener("keydown",t),e.preventDefault(),v.submit.click(),!1};v&&v.addEventListener("keydown",t);for(var n,r=function(e){var t,n=h.commentReplyClass;e&&e.childNodes||(e=C);t=C.getElementsByClassName?e.getElementsByClassName(n):e.querySelectorAll("."+n);return t}(e),o=0,d=r.length;o