From 6c22a9038e8fd506601ee236a047377ae7efc6c4 Mon Sep 17 00:00:00 2001 From: BetaRays Date: Sun, 10 Nov 2024 17:19:03 +0100 Subject: [PATCH] Use data- attribute instead of span to store room name --- src/plugins/roomslist/templates/roomslist.js | 3 ++- src/plugins/roomslist/view.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/roomslist/templates/roomslist.js b/src/plugins/roomslist/templates/roomslist.js index 1065758d40..9b12459ea5 100644 --- a/src/plugins/roomslist/templates/roomslist.js +++ b/src/plugins/roomslist/templates/roomslist.js @@ -59,6 +59,7 @@ function tplRoomItem (el, room) { el.openRoom(ev)}> ${ room.get('num_unread') ? tplUnreadIndicator(room) : (room.get('has_activity') ? tplActivityIndicator() : '') } - ${room.getDisplayName()} + ${room.getDisplayName()} ${ api.settings.get('allow_bookmarks') ? tplBookmark(room) : '' } diff --git a/src/plugins/roomslist/view.js b/src/plugins/roomslist/view.js index 65640e4ed1..982db923c6 100644 --- a/src/plugins/roomslist/view.js +++ b/src/plugins/roomslist/view.js @@ -55,7 +55,7 @@ export class RoomsList extends CustomElement { async openRoom (ev) { ev.preventDefault(); const target = u.ancestor(/** @type {HTMLElement} */(ev.target), '.open-room'); - const name = target.querySelector(".room-name")?.textContent; + const name = target.getAttribute('data-room-name'); const jid = target.getAttribute('data-room-jid'); const data = { 'name': name || Strophe.unescapeNode(Strophe.getNodeFromJid(jid)) || jid