chat page now uses classname instead of queryselector to extract user name
This commit is contained in:
parent
4d10e172cc
commit
f06bf516dd
@ -70,7 +70,8 @@ for (let i = 0; i < userBoxes.length; i++) {
|
|||||||
passphrase = elem.value;
|
passphrase = elem.value;
|
||||||
elem.hidden = true;
|
elem.hidden = true;
|
||||||
}
|
}
|
||||||
let userName = this.querySelectorAll('span')[1].innerText;
|
console.log(this.getElementsByClassName('to-user-span'));
|
||||||
|
let userName = this.getElementsByClassName('to-user-span')[0].innerText;
|
||||||
document.getElementById('user-name-span').innerText = userName;
|
document.getElementById('user-name-span').innerText = userName;
|
||||||
populateMessages(userName, passphrase);
|
populateMessages(userName, passphrase);
|
||||||
sessionStorage.setItem('selectedUser', userName);
|
sessionStorage.setItem('selectedUser', userName);
|
||||||
|
@ -81,7 +81,7 @@
|
|||||||
<span th:if="${au.online == true}" class="online_icon"></span>
|
<span th:if="${au.online == true}" class="online_icon"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="user_info">
|
<div class="user_info">
|
||||||
<span th:text="${au.userName}">Khalid</span>
|
<span class="to-user-span" th:text="${au.userName}">Khalid</span>
|
||||||
<div th:switch="${au.online}">
|
<div th:switch="${au.online}">
|
||||||
<p th:case="true" th:text="${au.userName} + ' is online'">Khalid is online</p>
|
<p th:case="true" th:text="${au.userName} + ' is online'">Khalid is online</p>
|
||||||
<th:block th:case="false">
|
<th:block th:case="false">
|
||||||
|
Loading…
Reference in New Issue
Block a user