mirror of
https://github.com/discourse/discourse.git
synced 2025-02-03 13:04:59 +08:00
11 lines
358 B
JavaScript
11 lines
358 B
JavaScript
import registerUnbound from 'discourse/helpers/register-unbound';
|
|
|
|
registerUnbound('max-usernames', function(usernames, params) {
|
|
var maxLength = parseInt(params.max) || 3;
|
|
if (usernames.length > maxLength){
|
|
return usernames.slice(0, maxLength).join(", ") + ", +" + (usernames.length - maxLength);
|
|
} else {
|
|
return usernames.join(", ");
|
|
}
|
|
});
|