summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-09-23 07:04:59 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-09-23 07:04:59 -0700
commita24d9d67a6d6ee0b976068880476e69b432b1406 (patch)
tree4ec404fcb21117bfce0c54a96fc32422d79183fc /modules/comment
parent05275e2c07549ae9c40e647154fa442d796918b8 (diff)
parent7f066b34c9d965814c0a07a8f71e016edeb383d2 (diff)
Merge branch 'master' into talmdal_dev
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/js/comment.js12
-rw-r--r--modules/comment/views/comments.html.php2
2 files changed, 13 insertions, 1 deletions
diff --git a/modules/comment/js/comment.js b/modules/comment/js/comment.js
index bff83770..6e985626 100644
--- a/modules/comment/js/comment.js
+++ b/modules/comment/js/comment.js
@@ -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() {
diff --git a/modules/comment/views/comments.html.php b/modules/comment/views/comments.html.php
index 7eb34c20..dd706a23 100644
--- a/modules/comment/views/comments.html.php
+++ b/modules/comment/views/comments.html.php
@@ -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>