Fix emoji bar position

This commit is contained in:
cuom1999 2023-08-14 16:21:38 -05:00
parent 807ba554ca
commit 5de5e278ee
2 changed files with 10 additions and 7 deletions

View file

@ -499,9 +499,11 @@
$('#chat-box').scrollTop($('#chat-box')[0].scrollHeight);
load_dynamic_update({{last_msg}});
const button = document.querySelector('#emoji-button')
const tooltip = document.querySelector('.tooltip')
Popper.createPopper(button, tooltip)
const button = document.querySelector('#emoji-button');
const tooltip = document.querySelector('.tooltip');
Popper.createPopper(button, tooltip, {
placement: 'left-end',
});
function toggleEmoji() {
tooltip.classList.toggle('shown')
@ -513,8 +515,10 @@
});
// Đóng bảng emoji khi click bất kỳ chỗ nào trên màn hình
document.addEventListener("click", function() {
tooltip.classList.remove('shown'); // Ẩn bảng emoji
document.addEventListener("click", function(e) {
if (!tooltip.contains(e.target)) {
tooltip.classList.remove('shown'); // Ẩn bảng emoji
}
});
$('emoji-picker').on('emoji-click', function(e) {

View file

@ -43,9 +43,8 @@
}
.tooltip {
left: 120vh !important;
transform: translate(100px, 0) !important;
position: absolute;
z-index: 1000;
}
#loader {