From 8a8b9f5a0b174225230c2ddb2dc9a0cecb33208e Mon Sep 17 00:00:00 2001 From: Aurélien Bompard Date: Wed, 12 Jun 2013 20:55:20 +0200 Subject: Paginate the list of liked messages in the user profile --- hyperkitty/static/js/hyperkitty.js | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'hyperkitty/static/js/hyperkitty.js') diff --git a/hyperkitty/static/js/hyperkitty.js b/hyperkitty/static/js/hyperkitty.js index 5545cb9..ffdf5e1 100644 --- a/hyperkitty/static/js/hyperkitty.js +++ b/hyperkitty/static/js/hyperkitty.js @@ -451,10 +451,10 @@ function update_list_properties(url) { /* - * Last viewed threads in the user's profile + * Last viewed threads and votes in the user's profile */ -function update_last_views(base_url) { - var container = $(".views"); +function update_user_profile_part(container, base_url) { + container = $(container); var loader = container.prev(".ajaxloader"); function _update(url) { loader.show(); @@ -466,6 +466,24 @@ function update_last_views(base_url) { e.preventDefault(); _update(base_url + $(this).attr("href")); }); + // setup cancellation links + container.find("a.cancel").click(function(e) { + e.preventDefault(); + var form = $(this).parents("form").first(); + var data = form_to_json(form); + $.ajax({ + type: "POST", + url: form.attr("action"), + data: data, + dataType: "json", + success: function(response) { + form.parents("tr").remove(); + }, + error: function(jqXHR, textStatus, errorThrown) { + alert(jqXHR.responseText); + } + }); + }); }, error: function(jqXHR, textStatus, errorThrown) { //alert(jqXHR.responseText); -- cgit