tags display: instead of limiting to 5 tags, limit by container width %

This commit is contained in:
Andrew Dolgov
2023-03-01 21:41:52 +03:00
parent 04c2fa9f15
commit b7a6c948d0
9 changed files with 87 additions and 3 deletions
+1 -3
View File
@@ -146,10 +146,8 @@ const Article = {
</div>`;
},
renderTags: function (id, tags) {
const tags_short = tags.length > 5 ? tags.slice(0, 5) : tags;
return `<span class="tags" title="${tags.join(", ")}" data-tags-for="${id}">
${tags_short.length > 0 ? tags_short.map((tag) => `
${tags.length > 0 ? tags.map((tag) => `
<a href="#" onclick="Feeds.open({feed: '${tag.trim()}'})" class="tag">${tag}</a>`
).join(", ") : `${__("no tags")}`}</span>`;
},