diff options
author | Marc Alexander <admin@m-a-styles.de> | 2012-12-15 23:23:32 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2012-12-15 23:23:32 +0100 |
commit | b90a56a4093fd2a13c486fa92fc808c020a35a52 (patch) | |
tree | 6d04e03f05a5bd599ca10731422d460f067ea17c | |
parent | 61ef870fd50171c9234e3621e3bfae53834ae85b (diff) | |
download | forums-b90a56a4093fd2a13c486fa92fc808c020a35a52.tar forums-b90a56a4093fd2a13c486fa92fc808c020a35a52.tar.gz forums-b90a56a4093fd2a13c486fa92fc808c020a35a52.tar.bz2 forums-b90a56a4093fd2a13c486fa92fc808c020a35a52.tar.xz forums-b90a56a4093fd2a13c486fa92fc808c020a35a52.zip |
[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
-rw-r--r-- | phpBB/styles/prosilver/template/ajax.js | 6 |
1 files 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); |