fixing alignment issues with long user and topic names
This commit is contained in:
@@ -8,7 +8,7 @@ export const MIME_EXTENSIONS = ['jpg', 'gif', 'png',
|
||||
|
||||
// Get an URL from a theCard photo: either create a data: URL or return reference URL.
|
||||
export function makeImageUrl(photo) {
|
||||
if (photo) {
|
||||
if (typeof photo == 'object') {
|
||||
if (photo.data && photo.type) {
|
||||
const mime = photo.type.startsWith('image/') ? photo.type : ('image/' + photo.type);
|
||||
return 'data:' + mime + ';base64,' + photo.data;
|
||||
|
||||
+7
-1
@@ -20,9 +20,10 @@ export function updateFavicon(count) {
|
||||
}
|
||||
|
||||
// Create theCard which represents user's or topic's "public" info.
|
||||
export function theCard(fn, imageUrl, imageMimeType) {
|
||||
export function theCard(fn, imageUrl, imageMimeType, note) {
|
||||
let card = null;
|
||||
fn = fn && fn.trim();
|
||||
note = note && note.trim();
|
||||
|
||||
if (fn) {
|
||||
card = {
|
||||
@@ -30,6 +31,11 @@ export function theCard(fn, imageUrl, imageMimeType) {
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof note == 'string') {
|
||||
card = card || {};
|
||||
card.note = note ? note : Tinode.DEL_CHAR;
|
||||
}
|
||||
|
||||
if (imageUrl) {
|
||||
card = card || {};
|
||||
let mimeType = imageMimeType;
|
||||
|
||||
Reference in New Issue
Block a user