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/css/hyperkitty-message.css | 6 +++++- hyperkitty/static/js/hyperkitty.js | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'hyperkitty/static') diff --git a/hyperkitty/static/css/hyperkitty-message.css b/hyperkitty/static/css/hyperkitty-message.css index edc5cab..3978015 100644 --- a/hyperkitty/static/css/hyperkitty-message.css +++ b/hyperkitty/static/css/hyperkitty-message.css @@ -194,7 +194,7 @@ } /* The email thread */ -.even, .odd { +.even, .odd, .temporary { border-top: 1px solid rgb(179, 179, 179); padding: 1em; margin: 20px 0px 20px 0px; @@ -205,6 +205,10 @@ .odd { background-color: rgb(238, 238, 238); } +.temporary { + background-color: rgb(215, 215, 229); + display: none; +} .email-body { white-space: pre; 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