From b90a56a4093fd2a13c486fa92fc808c020a35a52 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 15 Dec 2012 23:23:32 +0100 Subject: [PATCH] [ticket/10954] Join array of class names instead of creating a string Previously the string for selecting the correct classes was created directly. Due to that a subsequent comma had to be removed. By joining the array of class names with a separator this can be omitted. PHPBB3-10954 --- phpBB/styles/prosilver/template/ajax.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js index f1859484f3..78e82f6f4e 100644 --- a/phpBB/styles/prosilver/template/ajax.js +++ b/phpBB/styles/prosilver/template/ajax.js @@ -46,6 +46,7 @@ phpbb.add_ajax_callback('mark_topics_read', function(res) { var iconsState = ['', '_hot', '_hot_mine', '_locked', '_locked_mine', '_mine']; var unreadClassSelectors = ''; var classArray = {}; + var classNames = []; $.each(iconsArray, function(unreadClass, readClass) { $.each(iconsState, function(key, value) { @@ -57,12 +58,11 @@ phpbb.add_ajax_callback('mark_topics_read', function(res) { currentClass[unreadClass + value] = readClass + value; $.extend(classArray, currentClass); - unreadClassSelectors += '.' + unreadClass + value + ','; + classNames[classNames.length] = unreadClass; }); }); - // Remove trailing comma - unreadClassSelectors = unreadClassSelectors.substring(0, unreadClassSelectors.length - 1); + unreadClassSelectors = '.' + classNames.join(',.'); $('li.row').find(unreadClassSelectors).each(function() { var currentObject = $(this);