1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-25 20:45:16 +02:00

[ticket/10954] Simplify marking forums read and fix topic marking

PHPBB3-10954
This commit is contained in:
Marc Alexander
2012-12-15 23:48:33 +01:00
parent b90a56a409
commit f4ff335369

View File

@ -6,19 +6,20 @@
phpbb.add_ajax_callback('mark_forums_read', function(res) {
var readTitle = res.NO_UNREAD_POSTS;
var unreadTitle = res.UNREAD_POSTS;
var iconsArray = {
'forum_unread': 'forum_read',
'forum_unread_subforum': 'forum_read_subforum',
'forum_unread_locked': 'forum_read_locked'
};
$('li.row').find('dl.forum_unread, dl.forum_unread_subforum, dl.forum_unread_locked').each(function() {
var currentObject = $(this);
if (currentObject.hasClass('forum_unread')) {
currentObject.removeClass('forum_unread').addClass('forum_read');
}
else if (currentObject.hasClass('forum_unread_subforum')) {
currentObject.removeClass('forum_unread_subforum').addClass('forum_read_subforum');
}
else {
currentObject.removeClass('forum_unread_locked').addClass('forum_read_locked');
}
$.each(iconsArray, function(unreadClass, readClass) {
if (currentObject.hasClass(unreadClass)) {
currentObject.removeClass(unreadClass).addClass(readClass);
}
});
currentObject.children('dt[title=' + unreadTitle + ']').attr('title', readTitle);
});
@ -58,7 +59,7 @@ phpbb.add_ajax_callback('mark_topics_read', function(res) {
currentClass[unreadClass + value] = readClass + value;
$.extend(classArray, currentClass);
classNames[classNames.length] = unreadClass;
classNames[classNames.length] = unreadClass + value;
});
});