From ab60a8ea86e2b4d0174a4bcdd6a7c1abdb78f9e5 Mon Sep 17 00:00:00 2001 From: Aurélien Bompard Date: Fri, 17 May 2013 13:00:21 +0200 Subject: Dynamically insert replies in the thread Closes: #47 --- hyperkitty/static/js/hyperkitty.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'hyperkitty/static/js/hyperkitty.js') diff --git a/hyperkitty/static/js/hyperkitty.js b/hyperkitty/static/js/hyperkitty.js index ddebd09..a06aa79 100644 --- a/hyperkitty/static/js/hyperkitty.js +++ b/hyperkitty/static/js/hyperkitty.js @@ -202,14 +202,17 @@ function setup_replies(baseElem) { $.ajax({ type: "POST", url: form.attr("action"), - //dataType: "json", + dataType: "json", data: data, success: function(response) { + var reply = $(response.message_html); + reply.insertAfter(form.parents(".email").first().parent()); form.parents(".reply-form").first().slideUp(function() { form.find("textarea").val(""); + reply.slideDown(); }); $('
' - + response + '
') + + response.result + '') .appendTo(form.parents('.email-info').first()) .delay(2000).fadeOut('slow', function() { $(this).remove(); }); }, -- cgit