Преглед изворни кода

Fix missing ajax for comment adding

k4be пре 1 година
родитељ
комит
9d27ea9546
1 измењених фајлова са 6 додато и 1 уклоњено
  1. 6 1
      comment.js

+ 6 - 1
comment.js

@@ -64,6 +64,7 @@ function refreshComments() {
 		url: scriptUrlPrefix+'getcomments.php',
 		success: function(data) {
 			$('#comments').html(data);
+			addCommentFormSubmitAction();
 		},
 	});
 }
@@ -72,7 +73,11 @@ function commentsImageReplace(image) {
 	$('#comment-id').val(image.id);
 }
 
-$(document).ready(function() {
+function addCommentFormSubmitAction() {
 	$('#comment-form').on('submit', commentFormSubmit);
+}
+
+$(document).ready(function() {
+	addCommentFormSubmitAction();
 });