summaryrefslogtreecommitdiffstats
path: root/hyperkitty/static/js/hyperkitty-thread.js
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2013-07-11 17:18:25 +0200
committerAurélien Bompard <aurelien@bompard.org>2013-07-11 17:18:25 +0200
commit39deff37c950534d2a44e4bd040e49118b34a731 (patch)
tree5f950b3c0c9e2ca81b1c6192ea1ef280e0ec7e90 /hyperkitty/static/js/hyperkitty-thread.js
parent2c7c64b084040ad0666b15c511ff18bb96fc79b9 (diff)
downloadhyperkitty-39deff37c950534d2a44e4bd040e49118b34a731.tar.gz
hyperkitty-39deff37c950534d2a44e4bd040e49118b34a731.tar.xz
hyperkitty-39deff37c950534d2a44e4bd040e49118b34a731.zip
Add the category on the threads list
Diffstat (limited to 'hyperkitty/static/js/hyperkitty-thread.js')
-rw-r--r--hyperkitty/static/js/hyperkitty-thread.js14
1 files changed, 8 insertions, 6 deletions
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();
});
}