forked from Adleraci/adlerka.top
Test meme voting
This commit is contained in:
@@ -621,4 +621,24 @@ async function getMemeImages() {
|
||||
memeImageSelector.appendChild(option);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
async function reloadMemeVotes(memeID) {
|
||||
let memeVoteCounterElement = document.getElementById(`meme_votes_counter_${memeID}`);
|
||||
|
||||
let memeVoteResponse = await doAction('/meme', {
|
||||
action: "getMemeVotes",
|
||||
meme_id: memeID
|
||||
}, "Počet hlasov k meme-u bol stiahnutý", "Nastala chyba pri sťahovaní počtu hlasov k meme-u", true);
|
||||
|
||||
memeVoteCounterElement.innerText = memeVoteResponse.NetVotes;
|
||||
}
|
||||
|
||||
async function voteMeme(memeID, isUpvote){
|
||||
await doAction("/meme", {
|
||||
action: "voteMeme",
|
||||
meme_id: memeID,
|
||||
is_upvote: isUpvote
|
||||
}, "Meme bol upvotenutý", "Nastala chyba pri upvoteovaní meme-u", true);
|
||||
await reloadMemeVotes(memeID);
|
||||
}
|
@@ -356,6 +356,21 @@ div#articleslist>article{
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.meme_info {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.meme {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.meme_body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
@media (max-width: 1050px) {
|
||||
|
||||
div#articleslist {
|
||||
|
Reference in New Issue
Block a user