fix dynamically created popovers

pull/102/head
Aevann 2023-01-27 18:36:11 +02:00
parent 895b3a5b7b
commit 3c61799977
2 changed files with 6 additions and 6 deletions

View File

@ -137,6 +137,12 @@ function register_new_elements(e) {
for (const element of onchange) { for (const element of onchange) {
element.onchange = ()=>{execute(element, 'onchange')}; element.onchange = ()=>{execute(element, 'onchange')};
} }
for (const element of document.getElementsByClassName('user-name')) {
element.onclick = (e) => {
popclick(e);
};
}
} }
register_new_elements(document); register_new_elements(document);

View File

@ -65,12 +65,6 @@ function popclick(e) {
}, 5); }, 5);
} }
for (const element of document.getElementsByClassName('user-name')) {
element.onclick = (e) => {
popclick(e);
};
}
document.addEventListener("click", function(){ document.addEventListener("click", function(){
active = document.activeElement.getAttributeNode("class"); active = document.activeElement.getAttributeNode("class");
if (active && active.nodeValue == "user-name text-decoration-none"){ if (active && active.nodeValue == "user-name text-decoration-none"){