From e1b086f0b8be61f38ad62a85df71cc976af1fd21 Mon Sep 17 00:00:00 2001 From: gravel Date: Wed, 20 Dec 2023 18:19:11 +0000 Subject: [PATCH] feat: open room modal with id prefix --- output/js/util.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/output/js/util.js b/output/js/util.js index 6aaec93..dc17f51 100644 --- a/output/js/util.js +++ b/output/js/util.js @@ -82,7 +82,11 @@ export const dom = { tbl_communities: () => document.getElementById("tbl_communities"), tbl_communities_content_rows: () => Array.from(dom.tbl_communities()?.rows)?.filter(row => !row.querySelector('th')), - community_row: (communityID) => document.querySelector(`.room-row[${ATTRIBUTES.ROW.IDENTIFIER}="${communityID}"]`), + community_row: (communityID, matchIdPrefix=false) => { + const identifier = ATTRIBUTES.ROW.IDENTIFIER; + const matches = matchIdPrefix ? '^=' : '='; + return document.querySelector(`.room-row[${identifier}${matches}"${communityID}"]`); + }, /** * @param {HTMLTableRowElement} row */