Revert "allow middleclick on inline suggestors"

This reverts commit 21a2ad3491.
pull/225/head
Aevann 2024-03-10 21:04:51 +02:00
parent 97a3f07304
commit 8ba378f6c7
3 changed files with 6 additions and 23 deletions

View File

@ -7806,7 +7806,3 @@ table.border-0 * {
.inline-modal-option.user-option span {
margin-left: 0 !important;
}
.inline-modal-option a {
color: var(--black);
}

View File

@ -99,15 +99,11 @@ function populate_inline_group_modal(results, textbox)
let group_option = document.createElement("div");
group_option.className = "inline-modal-option group-option " + (i === 1 ? "selected" : "");
group_option.tabIndex = 0;
let group_option_link = document.createElement("a");
group_option_link.href = `/!${name}`
let group_option_text = document.createElement("span");
group_option_text.textContent = name;
group_option_link.addEventListener('click', () => {
e.preventDefault();
group_option.addEventListener('click', () => {
close_inline_emoji_modal()
textbox.value = textbox.value.replace(new RegExp(current_word+"(?=\\s|$)", "gi"), `!${name} `)
textbox.focus()
@ -115,9 +111,7 @@ function populate_inline_group_modal(results, textbox)
markdown(textbox)
}
});
group_option.appendChild(group_option_link);
group_option_link.appendChild(group_option_text);
group_option.appendChild(group_option_text);
inline_carot_modal.appendChild(group_option);
}
if (i === 0) inline_carot_modal.style.display = "none";

View File

@ -99,10 +99,6 @@ function populate_inline_user_modal(results, textbox)
let user_option = document.createElement("div");
user_option.className = "inline-modal-option user-option " + (i === 1 ? "selected" : "");
user_option.tabIndex = 0;
let user_option_link = document.createElement("a");
user_option_link.href = `/@${name}`
let user_option_img = document.createElement("img");
user_option_img.className = "pp20";
user_option_img.src = `/@${name}/pic`
@ -111,8 +107,7 @@ function populate_inline_user_modal(results, textbox)
user_option_text.textContent = name;
user_option_link.addEventListener('click', (e) => {
e.preventDefault();
user_option.addEventListener('click', () => {
close_inline_emoji_modal()
textbox.value = textbox.value.replace(new RegExp(current_word+"(?=\\s|$)", "gi"), `@${name} `)
textbox.focus()
@ -120,10 +115,8 @@ function populate_inline_user_modal(results, textbox)
markdown(textbox)
}
});
user_option.appendChild(user_option_link);
user_option_link.appendChild(user_option_img);
user_option_link.appendChild(user_option_text);
user_option.appendChild(user_option_img);
user_option.appendChild(user_option_text);
inline_carot_modal.appendChild(user_option);
}
if (i === 0) inline_carot_modal.style.display = "none";