git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Commit ca2f1cdb9f35a2cf90f43e41e0a9670809627406

show an extra item in "and others" displays

Matt McKegg committed on 3/18/2017, 5:50:57 AM
Parent: aa9871f4563f9f8bd5c9f4f4553baf1d086bacd8

Files changed

modules/feed/html/rollup.jschanged
modules/feed/html/rollup.jsView
@@ -254,17 +254,25 @@
254254 }
255255
256256 function many (ids, fn) {
257257 ids = Array.from(ids)
258- var featuredIds = ids.slice(-3).reverse()
258+ var featuredIds = ids.slice(-4).reverse()
259259
260260 if (ids.length) {
261- if (ids.length > 3) {
261+ if (ids.length > 4) {
262262 return [
263263 fn(featuredIds[0]), ', ',
264- fn(featuredIds[1]),
265- ' and ', ids.length - 2, ' others'
264+ fn(featuredIds[1]), ', ',
265+ fn(featuredIds[2]), ' and ',
266+ ids.length - 3, ' others'
266267 ]
268+ } else if (ids.length === 4) {
269+ return [
270+ fn(featuredIds[0]), ', ',
271+ fn(featuredIds[1]), ', ',
272+ fn(featuredIds[2]), ' and ',
273+ fn(featuredIds[3])
274+ ]
267275 } else if (ids.length === 3) {
268276 return [
269277 fn(featuredIds[0]), ', ',
270278 fn(featuredIds[1]), ' and ',

Built with git-ssb-web