This commit is contained in:
Marijn Jansen
2019-03-21 20:10:09 +01:00
parent f22d93aece
commit 19f6a530da
99 changed files with 37 additions and 38 deletions

20
static/js/modal.js Normal file
View File

@@ -0,0 +1,20 @@
$('#detailModal').on('show.bs.modal', function (event) {
let card = $(event.relatedTarget); // Button that triggered the modal
let post_id = card.data('post_id');
$.post(`/api/post/${post_id}`, data => {
let post = data.post;
console.log(post);
$('#details-title').text(post.title);
$('#details-intro').text(post.intro);
$('#details-description').text(post.description);
// $('#details-images').text('');
// post.images.forEach(image => {
// $('#details-images').append(`<img src=${image}>`)
// });
});
});