From 0acc8c3900e4564fa3219116823d24b86c84a08b Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 12 Sep 2008 21:19:40 +0000 Subject: [PATCH] Add respondID and respondRoot args to cancelCommentReply(). see #7635 git-svn-id: https://develop.svn.wordpress.org/trunk@8877 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/comment-template.php | 4 ++-- wp-includes/js/comment-reply.js | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 8ca1818bbf..76d4b1aac9 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -867,10 +867,10 @@ function comment_reply_link($args = array(), $comment = null, $post = null) { return $link; } -function cancel_comment_reply_link($text = '', $respond_id = 'respond') { +function cancel_comment_reply_link($text = '', $respond_id = 'respond', $respond_root = 'content') { if ( empty($text) ) $text = __('Click here to cancel reply.'); - echo '' . $text . ''; + echo '' . $text . ''; } class Walker_Comment extends Walker { diff --git a/wp-includes/js/comment-reply.js b/wp-includes/js/comment-reply.js index 2ef8e73f2d..e234d9e356 100644 --- a/wp-includes/js/comment-reply.js +++ b/wp-includes/js/comment-reply.js @@ -19,13 +19,11 @@ function moveAddCommentForm(theId, threadId, respondId) { document.getElementById("comment").focus(); } -function cancelCommentReply() { - var addComment = document.getElementById("respond"); +function cancelCommentReply(respondId, respondRoot) { + var addComment = document.getElementById(respondId); var reRootElement = document.getElementById("cancel-comment-reply"); reRootElement.style.display = "none"; - var content = document.getElementById("content-main"); - if( !content ) - content = document.getElementById("content"); + var content = document.getElementById(respondRoot); if( content ) { addComment.parentNode.removeChild(addComment); content.appendChild(addComment);