Add autofocus
This commit is contained in:
parent
5fdbde912b
commit
bab5bc8318
@ -53,7 +53,7 @@
|
|||||||
<ul id="messages">
|
<ul id="messages">
|
||||||
<li><b>Rappel:</b> Tous les messages doivent parler de Denis !</li>
|
<li><b>Rappel:</b> Tous les messages doivent parler de Denis !</li>
|
||||||
</ul>
|
</ul>
|
||||||
<input id="message-input" type="text" placeholder="Écrivez votre message sur Denis ici...">
|
<input id="message-input" type="text" placeholder="Écrivez votre message sur Denis ici..." autofocus>
|
||||||
<img id="send" src="./images/send.png">
|
<img id="send" src="./images/send.png">
|
||||||
<img id="close" src="./images/cross.png">
|
<img id="close" src="./images/cross.png">
|
||||||
</div>
|
</div>
|
||||||
|
@ -29,7 +29,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
socket.on("new-message", (data) => {
|
socket.on("new-message", (data) => {
|
||||||
|
|
||||||
if(data.author != username) {
|
if(data.author != username) {
|
||||||
document.getElementById("ringtone").play();
|
document.getElementById("ringtone").play();
|
||||||
}
|
}
|
||||||
@ -65,6 +65,7 @@ const swiper = new Swiper('.swiper', {
|
|||||||
|
|
||||||
document.getElementById("chat-button").addEventListener("click", () => {
|
document.getElementById("chat-button").addEventListener("click", () => {
|
||||||
document.getElementById("chat").style.display = "block";
|
document.getElementById("chat").style.display = "block";
|
||||||
|
document.getElementById("message-input").focus();
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById("close").addEventListener("click", () => {
|
document.getElementById("close").addEventListener("click", () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user