From 39deff37c950534d2a44e4bd040e49118b34a731 Mon Sep 17 00:00:00 2001 From: Aurélien Bompard Date: Thu, 11 Jul 2013 17:18:25 +0200 Subject: Add the category on the threads list --- hyperkitty/static/js/hyperkitty-thread.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'hyperkitty/static/js/hyperkitty-thread.js') diff --git a/hyperkitty/static/js/hyperkitty-thread.js b/hyperkitty/static/js/hyperkitty-thread.js index f2c3cd0..2ce664d 100644 --- a/hyperkitty/static/js/hyperkitty-thread.js +++ b/hyperkitty/static/js/hyperkitty-thread.js @@ -25,15 +25,16 @@ */ function setup_category() { - $("#thread-category form").submit(function (e) { + $(".thread-category form").submit(function (e) { e.preventDefault(); + var widget = $(this).parents(".thread-category").first(); $.ajax({ type: "POST", //dataType: "json", data : $(this).serialize(), url: $(this).attr("action"), success: function(data) { - $("#thread-category").html(data); + widget.html(data); setup_category(); }, error: function(jqXHR, textStatus, errorThrown) { @@ -42,12 +43,13 @@ function setup_category() { } }); }); - $("#thread-category a.label").click(function(e) { + $(".thread-category a.label").click(function(e) { e.preventDefault(); - $(this).hide(); - $("#thread-category form").show(); + $(this).hide() + .parents(".thread-category").first() + .find("form").show(); }); - $("#thread-category form select").change(function() { + $(".thread-category form select").change(function() { $(this).parents("form").first().submit(); }); } -- cgit