diff options
author | Marc Alexander <admin@m-a-styles.de> | 2012-12-18 00:48:50 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2012-12-18 00:48:50 +0100 |
commit | fb60f603ba5ac26004747e976a194ea9d15bcf4b (patch) | |
tree | c21f352984dc51dc3b96149fb065b87639247c8b | |
parent | 703b77cb77fa5a99b91cf95220d779bba9ac96d6 (diff) | |
download | forums-fb60f603ba5ac26004747e976a194ea9d15bcf4b.tar forums-fb60f603ba5ac26004747e976a194ea9d15bcf4b.tar.gz forums-fb60f603ba5ac26004747e976a194ea9d15bcf4b.tar.bz2 forums-fb60f603ba5ac26004747e976a194ea9d15bcf4b.tar.xz forums-fb60f603ba5ac26004747e976a194ea9d15bcf4b.zip |
[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
-rw-r--r-- | phpBB/styles/prosilver/template/ajax.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js index 41764d5d72..0357b7c59e 100644 --- a/phpBB/styles/prosilver/template/ajax.js +++ b/phpBB/styles/prosilver/template/ajax.js @@ -50,7 +50,7 @@ phpbb.add_ajax_callback('mark_topics_read', function(res) { }; var iconsState = ['', '_hot', '_hot_mine', '_locked', '_locked_mine', '_mine']; var unreadClassSelectors = ''; - var classArray = {}; + var classMap = {}; var classNames = []; $.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') { return true; } - var currentClass = {}; - currentClass[unreadClass + value] = readClass + value; - $.extend(classArray, currentClass); - - classNames[classNames.length] = unreadClass + value; + classMap[unreadClass + value] = readClass + value; + classNames.push(unreadClass + value); }); }); @@ -71,7 +68,7 @@ phpbb.add_ajax_callback('mark_topics_read', function(res) { $('li.row').find(unreadClassSelectors).each(function() { var $this = $(this); - $.each(classArray, function(unreadClass, readClass) { + $.each(classMap, function(unreadClass, readClass) { if ($this.hasClass(unreadClass)) { $this.removeClass(unreadClass).addClass(readClass); } @@ -80,7 +77,7 @@ phpbb.add_ajax_callback('mark_topics_read', function(res) { }); // Remove link to first unread post - $('span.icon_topic_newest').remove(); + $('a').has('span.icon_topic_newest').remove(); // Update mark topics read links $('[data-ajax="mark_topics_read"]').attr('href', res.U_MARK_TOPICS); |