Update meme voting

This commit is contained in:
2024-04-27 12:17:20 +02:00
parent cad1e333fe
commit 8702a549ab
3 changed files with 11 additions and 6 deletions

View File

@@ -628,6 +628,9 @@ async function reloadMemeVotes(memeID) {
let memeVoteCounterElement = document.getElementById(`meme_votes_counter_${memeID}`);
let memeVoteUpvoteElement = document.getElementById(`meme_votes_upvote_${memeID}`);
let memeVoteDownvoteElement = document.getElementById(`meme_votes_downvote_${memeID}`);
let memeVoteUpvoteButtonElement = document.getElementById(`meme_votes_upvote_button_${memeID}`);
let memeVoteDownvoteButtonElement = document.getElementById(`meme_votes_downvote_button_${memeID}`);
let memeVoteResponse = await doAction('/meme', {
action: "getMemeVotes",
@@ -649,17 +652,17 @@ async function reloadMemeVotes(memeID) {
memeVoteCounterElement.classList.add("neutral");
}
memeVoteUpvoteElement.classList.remove('visual_hover');
memeVoteDownvoteElement.classList.remove('visual_hover');
memeVoteUpvoteButtonElement.classList.remove('visual_hover');
memeVoteDownvoteButtonElement.classList.remove('visual_hover');
if (userVote > 0) {
memeUpvoteVariant = "fill";
memeDownvoteVariant = "line";
memeVoteUpvoteElement.classList.add('visual_hover');
memeVoteUpvoteButtonElement.classList.add('visual_hover');
}
else if (userVote < 0) {
memeUpvoteVariant = "line";
memeDownvoteVariant = "fill";
memeVoteDownvoteElement.classList.add('visual_hover');
memeVoteDownvoteButtonElement.classList.add('visual_hover');
}
else {
memeUpvoteVariant = "line";

View File

@@ -360,6 +360,8 @@ div#articleslist>article{
display: flex;
flex-direction: row;
height: fit-content;
width: 100%;
justify-content: right;
}
.meme, .meme_body {