comment reply form now has a cancel button

This commit is contained in:
Jordan Scales 2012-08-30 16:49:49 -04:00
parent a428dc31e7
commit 14fe4e6623

View file

@ -216,7 +216,10 @@ $(document).ready(function() {
box.html($("#comment_form").clone());
box.find("ol").remove();
console.log(box.find('button.comment-preview'));
box.find('button.comment-preview').after('<a class="comment-cancel" href="#">Cancel</a>');
box.find("textarea").focus();
var el = $("<input type=\"hidden\" " +
@ -228,6 +231,10 @@ $(document).ready(function() {
return false;
});
$("a.comment-cancel").live("click", function() {
$(this).parents('div.comment_reply form').remove();
});
$("a.comment_editor").live("click", function() {
var li = $(this).parents("li.comment").first();
li.load("/comments/" + $(li).attr("data-shortid") + "/edit",