From b310fab1f8e88371e4f2f1fa41173e1fc5eddb60 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 22 Sep 2009 07:59:26 -0700 Subject: 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. --- modules/comment/js/comment.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'modules/comment/js/comment.js') 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() { -- cgit v1.2.3