mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-04-30 10:09:12 -04:00
Change the link on the "Be first to comment" link to do a request to the server to get the comment add form. Fixes ticket #699.
This commit is contained in:
@@ -10,6 +10,18 @@ $("document").ready(function() {
|
||||
});
|
||||
}
|
||||
});
|
||||
$("#gNoComments").click(function(event) {
|
||||
event.preventDefault();
|
||||
if (!$("#gAddCommentForm").length) {
|
||||
$.get($(this).attr("href"),
|
||||
{},
|
||||
function(data) {
|
||||
$("#gCommentDetail").append(data);
|
||||
ajaxify_comment_form();
|
||||
});
|
||||
$("#gNoCommentsYet").remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function ajaxify_comment_form() {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<? if (!$comments->count()): ?>
|
||||
<p id="gNoCommentsYet">
|
||||
<?= t("No comments yet. Be the first to <a %attrs>comment</a>!",
|
||||
array("attrs" => html::mark_clean("href=\"#add_comment_form\" class=\"showCommentForm\""))) ?>
|
||||
array("attrs" => html::mark_clean("id= \"gNoComments\" href=\"" . url::site("form/add/comments/{$item->id}") . "\" class=\"showCommentForm\""))) ?>
|
||||
</p>
|
||||
<? endif ?>
|
||||
<ul>
|
||||
|
||||
Reference in New Issue
Block a user