1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/10954] Mark forums read without popup or page refresh

PHPBB3-10954
This commit is contained in:
Marc Alexander
2012-12-12 12:46:20 +01:00
parent 9420647c43
commit 7ce009f2e2
4 changed files with 49 additions and 7 deletions

View File

@@ -2,6 +2,22 @@
"use strict";
// This callback will mark all forum icons read
phpbb.add_ajax_callback('mark_forums_read', function(res) {
var read_title = res.NO_UNREAD_POSTS;
var unread_title = res.UNREAD_POSTS;
$('li.row dl.forum_unread').each(function(e) {
$(this).removeClass('forum_unread').addClass('forum_read');
$(this).children('dt[title=' + unread_title + ']').attr('title', read_title);
});
$('li.row dl.forum_unread_subforum').each(function(e) {
$(this).removeClass('forum_unread_subforum').addClass('forum_read_subforum');
$(this).children('dt[title=' + unread_title + ']').attr('title', read_title);
});
});
// This callback finds the post from the delete link, and removes it.
phpbb.add_ajax_callback('post_delete', function() {
var el = $(this),