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

git-svn-id: http://svn.automattic.com/wordpress/trunk@8877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-09-12 21:19:40 +00:00
parent 5e8c59bea7
commit dcf62be039
2 changed files with 5 additions and 7 deletions

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 {

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);