add current user styling
This commit is contained in:
parent
151ac909a1
commit
fb1111f39f
|
|
@ -118,3 +118,7 @@ tr.user-waiting > td {
|
||||||
background-color: #ece1be !important;
|
background-color: #ece1be !important;
|
||||||
--bs-table-bg-state: #ece1be !important;
|
--bs-table-bg-state: #ece1be !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.user-current {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
@ -159,6 +159,8 @@ function sortVMList() {
|
||||||
|
|
||||||
function sortUserList() {
|
function sortUserList() {
|
||||||
users.sort((a, b) => {
|
users.sort((a, b) => {
|
||||||
|
if (a.user.username === w.username && (a.user.turn >= b.user.turn)) return -1;
|
||||||
|
if (b.user.username === w.username && (b.user.turn >= a.user.turn)) return 1;
|
||||||
if (a.user.turn === b.user.turn) return 0;
|
if (a.user.turn === b.user.turn) return 0;
|
||||||
if (a.user.turn === -1) return 1;
|
if (a.user.turn === -1) return 1;
|
||||||
if (b.user.turn === -1) return -1;
|
if (b.user.turn === -1) return -1;
|
||||||
|
|
@ -229,6 +231,8 @@ function addUser(user : User) {
|
||||||
tr.classList.add("user-unregistered");
|
tr.classList.add("user-unregistered");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (user.username === w.username)
|
||||||
|
tr.classList.add("user-current");
|
||||||
tr.appendChild(td);
|
tr.appendChild(td);
|
||||||
elements.userlist.appendChild(tr);
|
elements.userlist.appendChild(tr);
|
||||||
if (olduser !== undefined) olduser.element = tr;
|
if (olduser !== undefined) olduser.element = tr;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user