From dcf62be0398054b1c87cf044f90130f5738ca692 Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 12 Sep 2008 21:19:40 +0000 Subject: [PATCH] Add respondID and respondRoot args to cancelCommentReply(). see #7635 git-svn-id: http://svn.automattic.com/wordpress/trunk@8877 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 8ca1818bb..76d4b1aac 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 2ef8e73f2..e234d9e35 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);