Commit ca2f1cdb9f35a2cf90f43e41e0a9670809627406
show an extra item in "and others" displays
Matt McKegg committed on 3/18/2017, 5:50:57 AMParent: aa9871f4563f9f8bd5c9f4f4553baf1d086bacd8
Files changed
modules/feed/html/rollup.js | changed |
modules/feed/html/rollup.js | ||
---|---|---|
@@ -254,17 +254,25 @@ | ||
254 | 254 | } |
255 | 255 | |
256 | 256 | function many (ids, fn) { |
257 | 257 | ids = Array.from(ids) |
258 | - var featuredIds = ids.slice(-3).reverse() | |
258 | + var featuredIds = ids.slice(-4).reverse() | |
259 | 259 | |
260 | 260 | if (ids.length) { |
261 | - if (ids.length > 3) { | |
261 | + if (ids.length > 4) { | |
262 | 262 | return [ |
263 | 263 | 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' | |
266 | 267 | ] |
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 | + ] | |
267 | 275 | } else if (ids.length === 3) { |
268 | 276 | return [ |
269 | 277 | fn(featuredIds[0]), ', ', |
270 | 278 | fn(featuredIds[1]), ' and ', |
Built with git-ssb-web