Fix variable shadowing

This commit is contained in:
Cohee
2024-07-13 11:52:43 +03:00
parent 974f142f24
commit 63c5330920

View File

@@ -9243,14 +9243,14 @@ jQuery(async function () {
immediately ? autoFitEditTextArea(e.target) : autoFitEditTextAreaDebounced(e.target); immediately ? autoFitEditTextArea(e.target) : autoFitEditTextAreaDebounced(e.target);
} }
}); });
const chatElement = document.getElementById('chat'); const chatElementScroll = document.getElementById('chat');
chatElement.addEventListener('wheel', function () { chatElementScroll.addEventListener('wheel', function () {
scrollLock = true; scrollLock = true;
}, { passive: true }); }, { passive: true });
chatElement.addEventListener('touchstart', function () { chatElementScroll.addEventListener('touchstart', function () {
scrollLock = true; scrollLock = true;
}, { passive: true }); }, { passive: true });
chatElement.addEventListener('scroll', function () { chatElementScroll.addEventListener('scroll', function () {
if (is_use_scroll_holder) { if (is_use_scroll_holder) {
this.scrollTop = scroll_holder; this.scrollTop = scroll_holder;
is_use_scroll_holder = false; is_use_scroll_holder = false;
@@ -9806,7 +9806,7 @@ jQuery(async function () {
}); });
//confirms message deletion with the "ok" button //confirms message deletion with the "ok" button
$('#dialogue_del_mes_ok').click(async function () { $('#dialogue_del_mes_ok').on('click', async function () {
$('#dialogue_del_mes').css('display', 'none'); $('#dialogue_del_mes').css('display', 'none');
$('#send_form').css('display', css_send_form_display); $('#send_form').css('display', css_send_form_display);
$('.del_checkbox').each(function () { $('.del_checkbox').each(function () {
@@ -9822,7 +9822,7 @@ jQuery(async function () {
chat.length = this_del_mes; chat.length = this_del_mes;
await saveChatConditional(); await saveChatConditional();
chatElement.scrollTop(chatElement[0].scrollHeight); chatElement.scrollTop(chatElement[0].scrollHeight);
eventSource.emit(event_types.MESSAGE_DELETED, chat.length); await eventSource.emit(event_types.MESSAGE_DELETED, chat.length);
$('#chat .mes').removeClass('last_mes'); $('#chat .mes').removeClass('last_mes');
$('#chat .mes').last().addClass('last_mes'); $('#chat .mes').last().addClass('last_mes');
} else { } else {