fix award_modal with js-created comments
parent
668499846b
commit
1522158ed8
|
@ -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 awardtabs = document.getElementsByClassName('award-tab');
|
||||||
const awardsections = document.getElementsByClassName('award-section');
|
const awardsections = document.getElementsByClassName('award-section');
|
||||||
|
|
||||||
|
|
|
@ -152,6 +152,17 @@ function register_new_elements(e) {
|
||||||
for (const element of remove_files) {
|
for (const element of remove_files) {
|
||||||
element.onclick = () => {cancel_files(element)};
|
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);
|
register_new_elements(document);
|
||||||
|
|
Loading…
Reference in New Issue