From 9d584a528b8aa6b825a489ddf4bb9ecd50c54016 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 10 Jan 2009 07:55:16 +0000 Subject: Update the queue counts in the menu list whenever we approve/unapprove/spam a comment. --- modules/comment/views/admin_comments.html.php | 32 ++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'modules/comment/views') diff --git a/modules/comment/views/admin_comments.html.php b/modules/comment/views/admin_comments.html.php index 1cbdcd70..ae3051ad 100644 --- a/modules/comment/views/admin_comments.html.php +++ b/modules/comment/views/admin_comments.html.php @@ -3,16 +3,36 @@ var set_state_url = ""; function set_state(state, id) { - $.get(set_state_url.replace("__STATE__", state).replace("__ID__", id)); - $("#gComment-" + id).slideUp(); + $.get(set_state_url.replace("__STATE__", state).replace("__ID__", id), + {}, + function() { + $("#gComment-" + id).slideUp(); + update_menu(); + }); } var delete_url = ""; - function del(id) { - $.get(delete_url.replace("__ID__", id)); - $("#gComment-" + id).slideUp(); - } + +function del(id) { + $.get(delete_url.replace("__ID__", id), + {}, + function() { + $("#gComment-" + id).slideUp(); + update_menu(); + }); +} + +function update_menu() { + $.get("", {}, + function(data) { + for (var i = 0; i < data.length; i++) { + $("#gAdminCommentsMenu li:eq(" + i + ") a").html(data[i]); + } + }, + "json"); +} +
-- cgit v1.2.3