Correct author ellipsis and improve
This commit is contained in:
parent
0349d9abe7
commit
1419b44acf
3 changed files with 5 additions and 3 deletions
|
@ -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));
|
background-image: linear-gradient(to bottom, rgba(0, 0, 255, 0), rgba(0, 0, 255, 0.1));
|
||||||
}
|
}
|
||||||
#channel_contents_wrapper.not-at-bottom {
|
#channel_contents_wrapper.not-at-bottom {
|
||||||
transition-duration: 1s;
|
transition-duration: 0.5s;
|
||||||
background-position-y: 100%;
|
background-position-y: 100%;
|
||||||
border-bottom-color: rgba(170, 170, 170, 0.5);
|
border-bottom-color: rgba(170, 170, 170, 0.5);
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,6 +128,7 @@ function switchToChannel(client, team, channel) {
|
||||||
client.channelPosts(channel.id)
|
client.channelPosts(channel.id)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.info(`Got channel contents of ${channel.id} (${channel.name})`);
|
console.info(`Got channel contents of ${channel.id} (${channel.name})`);
|
||||||
|
response.order.reverse();
|
||||||
populateChannelContents(client, response);
|
populateChannelContents(client, response);
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|
|
@ -80,13 +80,14 @@ function populateChannelContents(client, contents) {
|
||||||
let createAtText = "";
|
let createAtText = "";
|
||||||
if (sim < DATE_SIMILARITY.date) createAtText += formatDdddMmYy(createAt);
|
if (sim < DATE_SIMILARITY.date) createAtText += formatDdddMmYy(createAt);
|
||||||
if (sim < DATE_SIMILARITY.minutes) createAtText += " " + formatHhMm(createAt);
|
if (sim < DATE_SIMILARITY.minutes) createAtText += " " + formatHhMm(createAt);
|
||||||
|
createAtDiv.title = createAt.toString();
|
||||||
createAtDiv.innerText = createAtText;
|
createAtDiv.innerText = createAtText;
|
||||||
createAtDiv.dateTime = createAt.toISOString();
|
createAtDiv.dateTime = createAt.toISOString();
|
||||||
|
|
||||||
const authorName = users[post.user_id] ? users[post.user_id].username : post.user_id;
|
const authorName = users[post.user_id] ? users[post.user_id].username : post.user_id;
|
||||||
const authorDiv = document.createElement("div");
|
const authorDiv = document.createElement("div");
|
||||||
authorDiv.className = "author";
|
authorDiv.className = "author";
|
||||||
authorDiv.innerText = `@${authorName}`;
|
authorDiv.innerText = authorName;
|
||||||
|
|
||||||
const postDiv = document.createElement("div");
|
const postDiv = document.createElement("div");
|
||||||
postDiv.className = "post";
|
postDiv.className = "post";
|
||||||
|
@ -124,7 +125,7 @@ function populateChannelContents(client, contents) {
|
||||||
postDiv.appendChild(attachmentsUl);
|
postDiv.appendChild(attachmentsUl);
|
||||||
}
|
}
|
||||||
|
|
||||||
nodes.unshift(postDiv);
|
nodes.push(postDiv);
|
||||||
}
|
}
|
||||||
|
|
||||||
byId("channel_contents").append(...nodes);
|
byId("channel_contents").append(...nodes);
|
||||||
|
|
Loading…
Reference in a new issue