Aevann 2023-07-01 03:13:57 +03:00
parent fedb366b6b
commit 21cd802ccb
4 changed files with 13 additions and 2 deletions

View File

@ -198,6 +198,9 @@ document.addEventListener("click", function (e) {
if (element.dataset.toggleelement) {
if (element.dataset.toggleelement.startsWith('#reply-'))
close_inline_speed_emoji_modal();
const toggling = document.querySelector(element.dataset.toggleelement)
const attr = element.dataset.toggleattr;

View File

@ -85,6 +85,8 @@ function toggleEdit(id){
actions.classList.toggle("d-none");
autoExpand(box);
markdown(box);
close_inline_speed_emoji_modal();
};

View File

@ -12,4 +12,6 @@ function togglePostEdit(id){
markdown(box);
box=document.getElementById("post-edit-title");
autoExpand(box);
close_inline_speed_emoji_modal();
};

View File

@ -364,6 +364,11 @@ function curr_word_is_emoji()
current_word.charAt(current_word.length-1) != ":";
}
function close_inline_speed_emoji_modal() {
selecting = false;
speed_carot_modal.style.display = "none";
}
function populate_speed_emoji_modal(results, textbox)
{
selecting = true;
@ -407,8 +412,7 @@ function populate_speed_emoji_modal(results, textbox)
if (current_word.includes("!")) name = `!${name}`
emoji_option.addEventListener('click', () => {
selecting = false;
speed_carot_modal.style.display = "none";
close_inline_speed_emoji_modal()
textbox.value = textbox.value.replace(new RegExp(current_word+"(?=\\s|$)", "gi"), `:${name}: `)
textbox.focus()
if (document.location.pathname != '/chat'){