summaryrefslogtreecommitdiff
path: root/modules/comment/views
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-01-10 07:55:16 +0000
committerBharat Mediratta <bharat@menalto.com>2009-01-10 07:55:16 +0000
commit9d584a528b8aa6b825a489ddf4bb9ecd50c54016 (patch)
tree27e6e43c96dfa2f3ebd3bc4930a2bdead6c1dd85 /modules/comment/views
parent03a5f08258b10141b01b8e5998ca85655f0b8f68 (diff)
Update the queue counts in the menu list whenever we
approve/unapprove/spam a comment.
Diffstat (limited to 'modules/comment/views')
-rw-r--r--modules/comment/views/admin_comments.html.php32
1 files changed, 26 insertions, 6 deletions
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 =
"<?= url::site("admin/comments/set_state/__ID__/__STATE__?csrf=" . access::csrf_token()) ?>";
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 =
"<?= url::site("admin/comments/delete/__ID__?csrf=" . access::csrf_token()) ?>";
- 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("<?= url::site("admin/comments/menu_labels") ?>", {},
+ function(data) {
+ for (var i = 0; i < data.length; i++) {
+ $("#gAdminCommentsMenu li:eq(" + i + ") a").html(data[i]);
+ }
+ },
+ "json");
+}
+
</script>
<div id="gAdminComments">