UX: Truncate topic link title/URL on desktop to prevent overflow.
This commit is contained in:
parent
38496985ef
commit
0f574f641e
|
@ -116,7 +116,14 @@ createWidget('topic-map-link', {
|
||||||
},
|
},
|
||||||
|
|
||||||
html(attrs) {
|
html(attrs) {
|
||||||
return attrs.title ? replaceEmoji(attrs.title) : attrs.url;
|
let content = attrs.title || attrs.url;
|
||||||
|
const truncateLength = 85;
|
||||||
|
|
||||||
|
if (content.length > truncateLength) {
|
||||||
|
content = `${content.substr(0, truncateLength).trim()}...`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return attrs.title ? replaceEmoji(content) : content;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue