Add respondID and respondRoot args to cancelCommentReply(). see #7635

git-svn-id: https://develop.svn.wordpress.org/trunk@8877 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2008-09-12 21:19:40 +00:00
parent 5af3c01ea2
commit 0acc8c3900
2 changed files with 5 additions and 7 deletions
+2 -2
View File
@@ -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 '<a href="#" onclick="cancelCommentReply(\'' . $respond_id . '\'); return false;">' . $text . '</a>';
echo '<a href="#" onclick="cancelCommentReply(\'' . $respond_id . '\', \'' . $respond_root . '\'); return false;">' . $text . '</a>';
}
class Walker_Comment extends Walker {
+3 -5
View File
@@ -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);