Correct author ellipsis and improve

This commit is contained in:
Midgard 2021-02-08 15:16:56 +01:00
parent 0349d9abe7
commit 1419b44acf
Signed by: midgard
GPG key ID: 511C112F1331BBB4
3 changed files with 5 additions and 3 deletions

View file

@ -158,7 +158,7 @@ ul#server_selection_list {
background-image: linear-gradient(to bottom, rgba(0, 0, 255, 0), rgba(0, 0, 255, 0.1));
}
#channel_contents_wrapper.not-at-bottom {
transition-duration: 1s;
transition-duration: 0.5s;
background-position-y: 100%;
border-bottom-color: rgba(170, 170, 170, 0.5);
}

View file

@ -128,6 +128,7 @@ function switchToChannel(client, team, channel) {
client.channelPosts(channel.id)
.then(response => {
console.info(`Got channel contents of ${channel.id} (${channel.name})`);
response.order.reverse();
populateChannelContents(client, response);
})
.catch(error => {

View file

@ -80,13 +80,14 @@ function populateChannelContents(client, contents) {
let createAtText = "";
if (sim < DATE_SIMILARITY.date) createAtText += formatDdddMmYy(createAt);
if (sim < DATE_SIMILARITY.minutes) createAtText += " " + formatHhMm(createAt);
createAtDiv.title = createAt.toString();
createAtDiv.innerText = createAtText;
createAtDiv.dateTime = createAt.toISOString();
const authorName = users[post.user_id] ? users[post.user_id].username : post.user_id;
const authorDiv = document.createElement("div");
authorDiv.className = "author";
authorDiv.innerText = `@${authorName}`;
authorDiv.innerText = authorName;
const postDiv = document.createElement("div");
postDiv.className = "post";
@ -124,7 +125,7 @@ function populateChannelContents(client, contents) {
postDiv.appendChild(attachmentsUl);
}
nodes.unshift(postDiv);
nodes.push(postDiv);
}
byId("channel_contents").append(...nodes);