move popover shit to register_new_elements

master
Aevann 2023-03-14 10:39:56 +02:00
parent 60c2f7e628
commit cee74418ad
1 changed files with 9 additions and 5 deletions

View File

@ -153,7 +153,15 @@ function register_new_elements(e) {
element.addEventListener('input', () => {
autoExpand(element)
});
}
}
const popover_triggers = document.getElementsByClassName('user-name');
for (const element of popover_triggers) {
element.onclick = (e) => {
if (!(e.ctrlKey || e.metaKey || e.shiftKey || e.altKey))
e.preventDefault();
};
}
}
register_new_elements(document);
@ -169,10 +177,6 @@ document.addEventListener("click", function(e){
else if (element.classList.contains('showmore')) {
showmore(element)
}
else if (element.classList.contains('user-name') || element.parentElement.classList.contains('user-name')) {
if (!(e.ctrlKey || e.metaKey || e.shiftKey || e.altKey))
e.preventDefault();
}
else if (element.classList.contains('remove-files')) {
cancel_files(element)
}