Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
19 righe
691 B
19 righe
691 B
<script type="text/javascript"> |
|
async function markPageAsRead() { |
|
let formData = new FormData(); |
|
let ids = []; |
|
formData.append("command", "MARK_AS_READ"); |
|
document.querySelectorAll(`[data-changelog]`).forEach((element) => { |
|
id = element.getAttribute('data-changelog'); |
|
ids.push(id); |
|
formData.append('ids[]', id) |
|
}) |
|
const response = await fetch("<?php echo $this->endpoint?>", { |
|
method: "POST", |
|
body: formData |
|
}) |
|
ids.forEach((id) => { |
|
document.querySelectorAll(`[data-new="${id}"]`).forEach((element) => {element.remove()}); |
|
}) |
|
} |
|
</script>
|
|
|