summaryrefslogtreecommitdiff
path: root/modules/comment/js/comment.js
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-09-21 21:29:13 -0700
committerBharat Mediratta <bharat@menalto.com>2009-09-21 21:29:13 -0700
commite5a78d39ec49332054cbc1a398d7c110e1d9191c (patch)
treec2acb4731a381b7a1b28fa5ed505a76adb23a3ef /modules/comment/js/comment.js
parent529ded3388673036314eefd5bfb1cfc0b76f7f9e (diff)
parent33690a32bcf132e5ab470ff77ba23c073ac26271 (diff)
Merge branch 'master' of git@github.com:gallery/gallery3 into bharat_dev
Conflicts: modules/gallery/controllers/albums.php
Diffstat (limited to 'modules/comment/js/comment.js')
-rw-r--r--modules/comment/js/comment.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/modules/comment/js/comment.js b/modules/comment/js/comment.js
index 9fd63c1a..bff83770 100644
--- a/modules/comment/js/comment.js
+++ b/modules/comment/js/comment.js
@@ -1,13 +1,15 @@
$("document").ready(function() {
$("#gAddCommentButton").click(function(event) {
event.preventDefault();
- $.get($(this).attr("href"),
- {},
- function(data) {
- $("#gCommentDetail").append(data);
- ajaxify_comment_form();
- });
- });
+ if (!$("#gAddCommentForm").length) {
+ $.get($(this).attr("href"),
+ {},
+ function(data) {
+ $("#gCommentDetail").append(data);
+ ajaxify_comment_form();
+ });
+ }
+ });
});
function ajaxify_comment_form() {
@@ -22,7 +24,7 @@ function ajaxify_comment_form() {
$.get(data.resource, function(data, textStatus) {
$("#gComments .gBlockContent ul:first").append("<li>"+data+"</li>");
$("#gComments .gBlockContent ul:first li:last").effect("highlight", {color: "#cfc"}, 8000);
- $("#gAddCommentForm").hide(2000);
+ $("#gAddCommentForm").hide(2000).remove();
$("#gNoCommentsYet").hide(2000);
});
}