Revize 2fe292f3
Přidáno uživatelem Ondřej Anděl před více než 3 roky(ů)
application/view/searchContent.php | ||
---|---|---|
606 | 606 |
return output; |
607 | 607 |
} |
608 | 608 |
|
609 |
function publishItem(id){ |
|
610 |
let item = data[id];
|
|
609 |
function publishItem(id, index){
|
|
610 |
let item = data[index];
|
|
611 | 611 |
const finishedChecked = document.getElementById("check-"+id).checked; |
612 | 612 |
|
613 | 613 |
const formData = new FormData(); |
... | ... | |
635 | 635 |
|
636 | 636 |
var xhr = new XMLHttpRequest(); |
637 | 637 |
xhr.open("POST", "./controller/UpdateController.php"); |
638 |
xhr.send(formData);//TODO VACI CHECK?
|
|
638 |
xhr.send(formData); |
|
639 | 639 |
setTimeout(function(){ |
640 | 640 |
location.reload(); |
641 | 641 |
}, 500); |
... | ... | |
646 | 646 |
data.forEach((item,id) => { |
647 | 647 |
result += "<tr>"; |
648 | 648 |
<?php if(isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] == true) {?> |
649 |
result += "<td><input type='checkbox' id='check-"+item.id+"' onchange='publishItem("+item.id+")' "+ ((item.finished === true) ? 'checked' : '') +" /></td>"; |
|
649 |
result += "<td><input type='checkbox' id='check-"+item.id+"' onchange='publishItem("+item.id+", "+ id+)' "+ ((item.finished === true) ? 'checked' : '') +" /></td>";
|
|
650 | 650 |
<?php }?> |
651 | 651 |
result += "<td>" + item.lemma.lemma + "</td>"; |
652 | 652 |
result += "<td>" + item.word + "</td>"; |
Také k dispozici: Unified diff
Fix: bug-fix (id in publish)