fix search

This commit is contained in:
AdrienLSH 2024-05-14 09:43:35 +02:00
parent e308e8f012
commit da789b3306
2 changed files with 5 additions and 10 deletions

View File

@ -64,7 +64,7 @@
font-size: 0.75em; font-size: 0.75em;
} }
#app #input_user{ #app #username-input{
color: green; color: green;
width: 8.5em; width: 8.5em;
height: 1.1em; height: 1.1em;

View File

@ -15,11 +15,7 @@ export default class extends AbstractView {
this.logged = await client.isAuthenticated(); this.logged = await client.isAuthenticated();
this.profiles = await client.profiles.all(); this.profiles = await client.profiles.all();
document.getElementById('username-input').oninput = () => this.display_users(this.logged, this.profiles); document.getElementById("username-input").oninput = () => this.display_users();
let search = document.getElementById("input_user");
if (search != undefined)
search.oninput = () => this.display_users();
this.last_add_chat = undefined; this.last_add_chat = undefined;
@ -41,18 +37,17 @@ export default class extends AbstractView {
return; return;
} }
var new_user = document.createElement("li"); const new_user = document.createElement("li");
// username // username
let username = document.createElement("a"); const username = document.createElement("a");
username.setAttribute('data-link', ''); username.setAttribute('data-link', '');
username.id = `username${user.id}`; username.id = `username${user.id}`;
username.href = `/profiles/${user.username}`; username.href = `/profiles/${user.username}`;
if (this.logged && user.id == client.me.id) if (this.logged && user.id == client.me.id)
username.style.color = "green"; username.style.color = "green";
else { else {
let profile = await client.profiles.getProfileId(user.id); const online = user.online;
let online = profile.online;
if (online == undefined) if (online == undefined)
username.style.color = "gray"; username.style.color = "gray";
else if (online == true) else if (online == true)