From fb84cbf5455cc9343f73d965edc3b0f7961868d8 Mon Sep 17 00:00:00 2001 From: Henri Bergius Date: Mon, 4 Dec 2017 19:02:26 +0100 Subject: [PATCH] Handle longer user lists --- elements/userlist.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/elements/userlist.js b/elements/userlist.js index 4b03694..be90a4e 100644 --- a/elements/userlist.js +++ b/elements/userlist.js @@ -53,6 +53,9 @@ class UserList extends Component { -webkit-animation-timing-function:ease-in-out; -webkit-animation-direction: alternate; } + .long .deco { + display: none; + } span.output { color: #fff; } @@ -67,11 +70,14 @@ class UserList extends Component { const el = document.createElement('div'); el.className = 'terminal'; el.innerHTML = ` -
user@c-beam> #who
+
user@c-beam> #who
${data.join(', ')}
total: ${data.length}
-
user@c-beam> _
+
user@c-beam> _
`; + if (data.join(', ').length > 100) { + el.classList.add('long'); + } return el; } }