mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 03:36:07 +03:00
Merge pull request #5276 from michel-zimmer/room-directory-clipped-uris
Fix room directory clipping links in the room's topic
This commit is contained in:
commit
489c5b9b0a
2 changed files with 8 additions and 1 deletions
|
@ -133,6 +133,10 @@ limitations under the License.
|
||||||
.mx_RoomDirectory_topic {
|
.mx_RoomDirectory_topic {
|
||||||
cursor: initial;
|
cursor: initial;
|
||||||
color: $light-fg-color;
|
color: $light-fg-color;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 3;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx_RoomDirectory_alias {
|
.mx_RoomDirectory_alias {
|
||||||
|
|
|
@ -35,7 +35,7 @@ import GroupStore from "../../stores/GroupStore";
|
||||||
import FlairStore from "../../stores/FlairStore";
|
import FlairStore from "../../stores/FlairStore";
|
||||||
|
|
||||||
const MAX_NAME_LENGTH = 80;
|
const MAX_NAME_LENGTH = 80;
|
||||||
const MAX_TOPIC_LENGTH = 160;
|
const MAX_TOPIC_LENGTH = 800;
|
||||||
|
|
||||||
function track(action) {
|
function track(action) {
|
||||||
Analytics.trackEvent('RoomDirectory', action);
|
Analytics.trackEvent('RoomDirectory', action);
|
||||||
|
@ -497,6 +497,9 @@ export default class RoomDirectory extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
let topic = room.topic || '';
|
let topic = room.topic || '';
|
||||||
|
// Additional truncation based on line numbers is done via CSS,
|
||||||
|
// but to ensure that the DOM is not polluted with a huge string
|
||||||
|
// we give it a hard limit before rendering.
|
||||||
if (topic.length > MAX_TOPIC_LENGTH) {
|
if (topic.length > MAX_TOPIC_LENGTH) {
|
||||||
topic = `${topic.substring(0, MAX_TOPIC_LENGTH)}...`;
|
topic = `${topic.substring(0, MAX_TOPIC_LENGTH)}...`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue