Commit 347b1556 authored by Clement Ho's avatar Clement Ho

[skip ci] Improve code for collapsed multiple assignees

parent 46f569b1
...@@ -7,14 +7,14 @@ export default { ...@@ -7,14 +7,14 @@ export default {
}, },
computed: { computed: {
title() { title() {
const max = this.users.length > 5 ? 5 : this.users.length; const maxRender = Math.min(5, this.users.length);
const firstFive = this.users.slice(0, max); const renderUsers = this.users.slice(0, maxRender);
const names = []; const names = [];
firstFive.forEach(u => names.push(u.name)); renderUsers.forEach(u => names.push(u.name));
if (this.users.length > max) { if (this.users.length > maxRender) {
names.push(`+${this.users.length - max} more`); names.push(`+${this.users.length - maxRender} more`);
} }
return names.join(', '); return names.join(', ');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment