Revize 176259e4
Přidáno uživatelem Ondřej Anděl před více než 3 roky(ů)
application/view/modals/editModal.html | ||
---|---|---|
315 | 315 |
const button = $(event.relatedTarget); |
316 | 316 |
const pseudo_id = button.data('pseudo-id');// Extract info from data-* attributes |
317 | 317 |
const title = button.data('title');// Extract info from data-* attributes |
318 |
$('#manuscript-m').multiSelect({ |
|
318 |
var $multis = $('#manuscript-m').multiSelect({
|
|
319 | 319 |
'noneText': 'nevybráno', |
320 | 320 |
}); |
321 | 321 |
|
... | ... | |
617 | 617 |
|
618 | 618 |
modal.find("#word").val(data.word); |
619 | 619 |
modal.find("#lemma").val(data.lemma.lemma); |
620 |
modal.find("#manuscript-m").val(data.manuscript); |
|
620 |
modal.find("#manuscript-m").val(data.manuscript);//TODO not sure if this one works... kinda does what it wants
|
|
621 | 621 |
|
622 | 622 |
//dynamic setting |
623 | 623 |
const morphem = data.tag.tag; |
... | ... | |
679 | 679 |
|
680 | 680 |
formData.append("word", modal.find("#word")[0].value); |
681 | 681 |
formData.append("lemma", modal.find("#lemma")[0].value); |
682 |
formData.append("manuscript", modal.find("#manuscript-m")[0].value); |
|
682 |
|
|
683 |
//this is to get data from manuscript --> possible better? |
|
684 |
var elements = modal.find("#manuscript-m").data('multiSelectContainer').find('input:checked'); |
|
685 |
let ms_value = []; |
|
686 |
Object.values(elements).forEach((item) => { |
|
687 |
if(item.value !== undefined){ |
|
688 |
ms_value.push(""+item.value); |
|
689 |
} |
|
690 |
}); |
|
691 |
|
|
692 |
formData.append("manuscript", ms_value.join()); |
|
683 | 693 |
formData.append("context", modal.find("#context")[0].value); |
684 | 694 |
formData.append("description", modal.find("#description")[0].value); |
685 | 695 |
formData.append("description2", modal.find("#description2")[0].value); |
... | ... | |
750 | 760 |
formData.append("finished", false); |
751 | 761 |
|
752 | 762 |
var xhr = new XMLHttpRequest(); |
753 |
xhr.open("POST", "../controller/InsertController.php");
|
|
763 |
xhr.open("POST", "./controller/InsertController.php"); |
|
754 | 764 |
xhr.send(formData); |
755 | 765 |
setTimeout(function(){ |
756 | 766 |
location.reload(); |
Také k dispozici: Unified diff
Feature #8350: Vytvoření modalů detailu a editu - napojení metod