mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-13 02:44:39 +08:00
hopefully fixed the scrolling issue,
fixed is typing not going away on result chat / to focus chat
This commit is contained in:
parent
1da9b4ee74
commit
03e77479a7
2 changed files with 30 additions and 2 deletions
|
|
@ -637,6 +637,7 @@ function mp_scrollChat() {
|
|||
if (scrollChat) {
|
||||
chatEl.scrollTop = chatEl.scrollHeight;
|
||||
chatEl2.scrollTop = chatEl2.scrollHeight;
|
||||
scrollChat = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1501,6 +1502,7 @@ $(".pageTest #result .tribeResultChat .chat .input input").keyup((e) => {
|
|||
Notifications.add("Message cannot be longer than 512 characters.", 0);
|
||||
return;
|
||||
}
|
||||
mp_sendIsTypingUpdate(false);
|
||||
MP.socket.emit("mp_chat_message", {
|
||||
isSystem: false,
|
||||
isLeader: MP.room.isLeader,
|
||||
|
|
@ -1556,6 +1558,7 @@ $(
|
|||
).on("scroll", (e) => {
|
||||
let chatEl = $(".pageTribe .lobby .chat .messages")[0];
|
||||
scrollChat = chatEl.scrollHeight - chatEl.scrollTop === chatEl.clientHeight;
|
||||
console.log(scrollChat);
|
||||
});
|
||||
|
||||
$(
|
||||
|
|
@ -1764,6 +1767,25 @@ $(document).on("click", "#tribeUserSettingsPopup .buttons .ban", (e) => {
|
|||
hideTribeUserSettingsPopup();
|
||||
});
|
||||
|
||||
$(document).on("keypress", (e) => {
|
||||
if (
|
||||
MP.state === 10 &&
|
||||
!$(".pageTribe .lobby .chat .input input").is(":focus") &&
|
||||
e.key === "/"
|
||||
) {
|
||||
$(".pageTribe .lobby .chat .input input").focus();
|
||||
e.preventDefault();
|
||||
}
|
||||
if (
|
||||
MP.state >= 28 &&
|
||||
!$(".pageTest #result .tribeResultChat .chat .input input").is(":focus") &&
|
||||
e.key === "/"
|
||||
) {
|
||||
$(".pageTest #result .tribeResultChat .chat .input input").focus();
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
let miniChartSettings = {
|
||||
type: "line",
|
||||
data: {
|
||||
|
|
|
|||
|
|
@ -1499,7 +1499,10 @@
|
|||
<div class="title">chat</div>
|
||||
<div class="messages"></div>
|
||||
<div class="input">
|
||||
<input type="text" placeholder="Send a message" />
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Send a message (press / to focus)"
|
||||
/>
|
||||
</div>
|
||||
<div class="whoIsTyping"></div>
|
||||
</div>
|
||||
|
|
@ -3780,7 +3783,10 @@
|
|||
<div class="title">chat</div>
|
||||
<div class="messages"></div>
|
||||
<div class="input">
|
||||
<input type="text" placeholder="Send a message" />
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Send a message (press / to focus)"
|
||||
/>
|
||||
</div>
|
||||
<div class="whoIsTyping"></div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue