Fixes the link count on the sidebar by only counting unique titles.

This commit is contained in:
Andre Pereira 2016-03-13 13:54:03 +00:00
parent 25dc5043e3
commit 129cc92ec9

View file

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