Removed use of ES6 Set.

This commit is contained in:
Andre Pereira 2016-03-13 14:31:03 +00:00
parent 129cc92ec9
commit e7a4900baf
1 changed files with 4 additions and 3 deletions

View File

@ -41,9 +41,10 @@ export default createWidget('post-gutter', {
}
if (state.collapsed) {
var differentTitles = new Set();
links.forEach(function(x) { differentTitles.add(x.title); });
const remaining = differentTitles.size - MAX_GUTTER_LINKS;
var differentTitles = [], allTitles = [];
links.forEach(function(x) { allTitles.push(x.title); });
differentTitles = allTitles.filter(function(item, i, ar){ return ar.indexOf(item) === i; });
const remaining = differentTitles.length - MAX_GUTTER_LINKS;
if (remaining > 0) {
result.push(h('li', h('a.toggle-more', I18n.t('post.more_links', {count: remaining}))));