fix award_modal with js-created comments

master
Aevann 2023-02-27 17:19:28 +02:00
parent 668499846b
commit 1522158ed8
2 changed files with 11 additions and 11 deletions

View File

@ -170,17 +170,6 @@ function giveaward(t) {
);
}
const data_url = document.querySelectorAll('[data-url]');
for (const element of data_url) {
if (element.dataset.nonce != nonce) {
console.log("Nonce check failed!")
continue
}
element.addEventListener('click', () => {
document.getElementById('giveaward').dataset.action = element.dataset.url
});
}
const awardtabs = document.getElementsByClassName('award-tab');
const awardsections = document.getElementsByClassName('award-section');

View File

@ -152,6 +152,17 @@ function register_new_elements(e) {
for (const element of remove_files) {
element.onclick = () => {cancel_files(element)};
}
const data_url = document.querySelectorAll('[data-url]');
for (const element of data_url) {
if (element.dataset.nonce != nonce) {
console.log("Nonce check failed!")
continue
}
element.addEventListener('click', () => {
document.getElementById('giveaward').dataset.action = element.dataset.url
});
}
}
register_new_elements(document);