comment reply form now has a cancel button
This commit is contained in:
parent
a428dc31e7
commit
14fe4e6623
|
@ -216,7 +216,10 @@ $(document).ready(function() {
|
||||||
|
|
||||||
box.html($("#comment_form").clone());
|
box.html($("#comment_form").clone());
|
||||||
box.find("ol").remove();
|
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();
|
box.find("textarea").focus();
|
||||||
|
|
||||||
var el = $("<input type=\"hidden\" " +
|
var el = $("<input type=\"hidden\" " +
|
||||||
|
@ -228,6 +231,10 @@ $(document).ready(function() {
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("a.comment-cancel").live("click", function() {
|
||||||
|
$(this).parents('div.comment_reply form').remove();
|
||||||
|
});
|
||||||
|
|
||||||
$("a.comment_editor").live("click", function() {
|
$("a.comment_editor").live("click", function() {
|
||||||
var li = $(this).parents("li.comment").first();
|
var li = $(this).parents("li.comment").first();
|
||||||
li.load("/comments/" + $(li).attr("data-shortid") + "/edit",
|
li.load("/comments/" + $(li).attr("data-shortid") + "/edit",
|
||||||
|
|
Loading…
Reference in a new issue