Fix bubble time white space
This commit is contained in:
parent
185b379d2a
commit
08cf99e749
4
.env
4
.env
@ -1,5 +1,5 @@
|
|||||||
API_ID=1025907
|
API_ID=1025907
|
||||||
API_HASH=452b0359b988148995f22ff0f4229750
|
API_HASH=452b0359b988148995f22ff0f4229750
|
||||||
VERSION=0.9.1
|
VERSION=0.9.1
|
||||||
VERSION_FULL=0.9.1 (28)
|
VERSION_FULL=0.9.1 (29)
|
||||||
BUILD=28
|
BUILD=29
|
||||||
|
@ -15,6 +15,15 @@ import { wrapReply } from "../wrappers";
|
|||||||
import Chat from "./chat";
|
import Chat from "./chat";
|
||||||
import RepliesElement from "./replies";
|
import RepliesElement from "./replies";
|
||||||
|
|
||||||
|
const NBSP = ' ';
|
||||||
|
|
||||||
|
const makeEdited = () => {
|
||||||
|
const edited = document.createElement('i');
|
||||||
|
edited.classList.add('edited');
|
||||||
|
_i18n(edited, 'EditedMessage');
|
||||||
|
return edited;
|
||||||
|
};
|
||||||
|
|
||||||
export namespace MessageRender {
|
export namespace MessageRender {
|
||||||
/* export const setText = () => {
|
/* export const setText = () => {
|
||||||
|
|
||||||
@ -32,26 +41,24 @@ export namespace MessageRender {
|
|||||||
|
|
||||||
const postViewsSpan = document.createElement('span');
|
const postViewsSpan = document.createElement('span');
|
||||||
postViewsSpan.classList.add('post-views');
|
postViewsSpan.classList.add('post-views');
|
||||||
postViewsSpan.innerText = formatNumber(message.views, 1);
|
postViewsSpan.innerHTML = formatNumber(message.views, 1);
|
||||||
|
|
||||||
const channelViews = document.createElement('i');
|
const channelViews = document.createElement('i');
|
||||||
channelViews.classList.add('tgico-channelviews', 'time-icon');
|
channelViews.classList.add('tgico-channelviews', 'time-icon');
|
||||||
|
|
||||||
args.push(postViewsSpan, ' ', channelViews);
|
args.push(postViewsSpan, channelViews);
|
||||||
if(postAuthor) {
|
if(postAuthor) {
|
||||||
const span = document.createElement('span');
|
const span = document.createElement('span');
|
||||||
span.innerHTML = RichTextProcessor.wrapEmojiText(postAuthor);
|
span.innerHTML = RichTextProcessor.wrapEmojiText(postAuthor) + ',' + NBSP;
|
||||||
args.push(span, ', ');
|
args.push(span);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let editedSpan: HTMLElement;
|
||||||
if(message.edit_date && chat.type !== 'scheduled' && !message.pFlags.edit_hide) {
|
if(message.edit_date && chat.type !== 'scheduled' && !message.pFlags.edit_hide) {
|
||||||
bubble.classList.add('is-edited');
|
bubble.classList.add('is-edited');
|
||||||
|
|
||||||
const edited = document.createElement('i');
|
args.unshift(editedSpan = makeEdited());
|
||||||
edited.classList.add('edited');
|
|
||||||
_i18n(edited, 'EditedMessage');
|
|
||||||
args.unshift(edited);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(chat.type !== 'pinned' && message.pFlags.pinned) {
|
if(chat.type !== 'pinned' && message.pFlags.pinned) {
|
||||||
@ -77,8 +84,12 @@ export namespace MessageRender {
|
|||||||
inner.classList.add('inner', 'tgico');
|
inner.classList.add('inner', 'tgico');
|
||||||
inner.title = title;
|
inner.title = title;
|
||||||
|
|
||||||
const clonedArgs = args.slice(0, -1).map(a => a instanceof HTMLElement ? a.cloneNode(true) : a);
|
let clonedArgs = args;
|
||||||
clonedArgs.push(formatTime(date)); // clone time
|
if(editedSpan) {
|
||||||
|
clonedArgs[clonedArgs.indexOf(editedSpan)] = makeEdited();
|
||||||
|
}
|
||||||
|
clonedArgs = clonedArgs.map(a => a instanceof HTMLElement && !a.classList.contains('i18n') ? a.cloneNode(true) as HTMLElement : a);
|
||||||
|
clonedArgs[clonedArgs.length - 1] = formatTime(date); // clone time
|
||||||
inner.append(...clonedArgs);
|
inner.append(...clonedArgs);
|
||||||
|
|
||||||
timeSpan.append(inner);
|
timeSpan.append(inner);
|
||||||
|
@ -1558,8 +1558,8 @@ $bubble-beside-button-width: 38px;
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
i {
|
i {
|
||||||
font-size: 1.15rem;
|
font-size: 1.125rem;
|
||||||
margin-right: .4rem;
|
margin-right: .375rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-icon {
|
&-icon {
|
||||||
@ -1569,7 +1569,7 @@ $bubble-beside-button-width: 38px;
|
|||||||
|
|
||||||
i.edited {
|
i.edited {
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
font-size: .8rem;
|
font-size: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inner {
|
.inner {
|
||||||
|
Loading…
Reference in New Issue
Block a user