WordPress.org

Make WordPress Core

Changeset 8877


Ignore:
Timestamp:
09/12/2008 09:19:40 PM (10 years ago)
Author:
ryan
Message:

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

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/comment-template.php

    r8876 r8877  
    868868}
    869869
    870 function cancel_comment_reply_link($text = '', $respond_id = 'respond') {
     870function cancel_comment_reply_link($text = '', $respond_id = 'respond', $respond_root = 'content') {
    871871    if ( empty($text) )
    872872        $text = __('Click here to cancel reply.');
    873     echo '<a href="#" onclick="cancelCommentReply(\'' . $respond_id . '\'); return false;">' . $text . '</a>';
     873    echo '<a href="#" onclick="cancelCommentReply(\'' . $respond_id . '\', \'' . $respond_root . '\'); return false;">' . $text . '</a>';
    874874}
    875875
  • trunk/wp-includes/js/comment-reply.js

    r8869 r8877  
    2020}
    2121
    22 function cancelCommentReply() {
    23     var addComment = document.getElementById("respond");           
     22function cancelCommentReply(respondId, respondRoot) {
     23    var addComment = document.getElementById(respondId);           
    2424    var reRootElement = document.getElementById("cancel-comment-reply");
    2525    reRootElement.style.display = "none";
    26     var content = document.getElementById("content-main");
    27     if( !content )
    28         content = document.getElementById("content");
     26    var content = document.getElementById(respondRoot);
    2927    if( content ) {
    3028        addComment.parentNode.removeChild(addComment);
Note: See TracChangeset for help on using the changeset viewer.