cancel button added to the reply-to-comment form.
svn path=/plone.app.discussion/trunk/; revision=27262
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
jq(document).ready(function() {
|
||||
/*
|
||||
* Show the reply-to-comment button only when Javascript is enabled.
|
||||
* Otherwise hide it, since the reply functions rely on jQuery.
|
||||
*/
|
||||
jq(".reply-to-comment-button").css("display" , "block")
|
||||
jq(document).ready(function() {
|
||||
/* Show the reply-to-comment button only when Javascript is enabled.
|
||||
* Otherwise hide it, since the reply functions relies on jQuery.
|
||||
*/
|
||||
jq(".reply-to-comment-button").css("display" , "block");
|
||||
});
|
||||
|
||||
|
||||
function createReplyToCommentForm(comment_id) {
|
||||
/*
|
||||
* This function creates a form to reply to a specific comment with
|
||||
@@ -40,4 +38,23 @@ function createReplyToCommentForm(comment_id) {
|
||||
new_action = old_action.replace("@@add-comment", "@@reply-to-comment");
|
||||
reply_form.attr("action", new_action);
|
||||
|
||||
/* Add a remove-reply-to-comment Javascript function to remove the form */
|
||||
cancel_reply_button = reply_div.find(".cancelreplytocomment");
|
||||
cancel_reply_button.attr("onclick", "removeReplyToCommentForm(" + comment_id +");")
|
||||
|
||||
/* Show the cancel button in the reply-to-comment form */
|
||||
cancel_reply_button.css("display", "inline")
|
||||
}
|
||||
|
||||
function removeReplyToCommentForm(comment_id) {
|
||||
/*
|
||||
* This function removes the reply-to-comment form of a specific comment.
|
||||
*/
|
||||
|
||||
/* find the reply-to-comment form and hide it again. */
|
||||
jq("#comment-" + comment_id).find(".reply").hide("slow")
|
||||
|
||||
/* Show the reply-to-comment button again. */
|
||||
jq("#reply-to-comment-" + comment_id + "-button").css("display", "block");
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user