mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-12 06:18:52 +00:00
[ticket/10954] Miscellaneous coding fixes
Remove obsolete or unneeded code. Also fix the behavior of removing icon_topic_newest by actually removing the link to the first unread post instead of just removing the icon. PHPBB3-10954
This commit is contained in:
parent
703b77cb77
commit
fb60f603ba
1 changed files with 5 additions and 8 deletions
|
@ -50,7 +50,7 @@ phpbb.add_ajax_callback('mark_topics_read', function(res) {
|
||||||
};
|
};
|
||||||
var iconsState = ['', '_hot', '_hot_mine', '_locked', '_locked_mine', '_mine'];
|
var iconsState = ['', '_hot', '_hot_mine', '_locked', '_locked_mine', '_mine'];
|
||||||
var unreadClassSelectors = '';
|
var unreadClassSelectors = '';
|
||||||
var classArray = {};
|
var classMap = {};
|
||||||
var classNames = [];
|
var classNames = [];
|
||||||
|
|
||||||
$.each(iconsArray, function(unreadClass, readClass) {
|
$.each(iconsArray, function(unreadClass, readClass) {
|
||||||
|
@ -59,11 +59,8 @@ phpbb.add_ajax_callback('mark_topics_read', function(res) {
|
||||||
if ((value == '_hot' || value == '_hot_mine') && unreadClass != 'topic_unread') {
|
if ((value == '_hot' || value == '_hot_mine') && unreadClass != 'topic_unread') {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
var currentClass = {};
|
classMap[unreadClass + value] = readClass + value;
|
||||||
currentClass[unreadClass + value] = readClass + value;
|
classNames.push(unreadClass + value);
|
||||||
$.extend(classArray, currentClass);
|
|
||||||
|
|
||||||
classNames[classNames.length] = unreadClass + value;
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -71,7 +68,7 @@ phpbb.add_ajax_callback('mark_topics_read', function(res) {
|
||||||
|
|
||||||
$('li.row').find(unreadClassSelectors).each(function() {
|
$('li.row').find(unreadClassSelectors).each(function() {
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
$.each(classArray, function(unreadClass, readClass) {
|
$.each(classMap, function(unreadClass, readClass) {
|
||||||
if ($this.hasClass(unreadClass)) {
|
if ($this.hasClass(unreadClass)) {
|
||||||
$this.removeClass(unreadClass).addClass(readClass);
|
$this.removeClass(unreadClass).addClass(readClass);
|
||||||
}
|
}
|
||||||
|
@ -80,7 +77,7 @@ phpbb.add_ajax_callback('mark_topics_read', function(res) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Remove link to first unread post
|
// Remove link to first unread post
|
||||||
$('span.icon_topic_newest').remove();
|
$('a').has('span.icon_topic_newest').remove();
|
||||||
|
|
||||||
// Update mark topics read links
|
// Update mark topics read links
|
||||||
$('[data-ajax="mark_topics_read"]').attr('href', res.U_MARK_TOPICS);
|
$('[data-ajax="mark_topics_read"]').attr('href', res.U_MARK_TOPICS);
|
||||||
|
|
Loading…
Add table
Reference in a new issue