Fix large card checkmarks toggle

This commit is contained in:
Tetrakern 2025-01-16 18:44:28 +01:00
parent dfde0cc075
commit f958cca073
4 changed files with 7 additions and 9 deletions

File diff suppressed because one or more lines are too long

6
js/complete.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -97,7 +97,6 @@ $thumbnail_args = array(
data-controller="fictioneer-large-card"
data-fictioneer-large-card-post-id-value="<?php echo $post_id; ?>"
data-fictioneer-large-card-story-id-value="<?php echo $story_id; ?>"
data-fictioneer-large-card-chapter-id-value="<?php echo $post_id; ?>"
data-action="click->fictioneer-large-card#cardClick"
<?php echo $card_attributes; ?>
>

View File

@ -2631,8 +2631,7 @@ application.register('fictioneer-large-card', class extends Stimulus.Controller
static values = {
postId: Number,
storyId: Number,
chapterId: Number
storyId: Number
}
initialize() {
@ -2694,7 +2693,7 @@ application.register('fictioneer-large-card', class extends Stimulus.Controller
const checkmarks = this.#data()?.checkmarks?.data?.[this.storyIdValue];
return !!checkmarks &&
(checkmarks.includes(this.chapterIdValue) || checkmarks.includes(this.storyIdValue));
(checkmarks.includes(this.postIdValue) || checkmarks.includes(this.storyIdValue));
}
cardClick(event) {
@ -2731,7 +2730,7 @@ application.register('fictioneer-large-card', class extends Stimulus.Controller
toggleCheckmarks() {
if (this.#loggedIn()) {
fcn_toggleCheckmark(this.storyIdValue, this.chapterIdValue);
fcn_toggleCheckmark(this.storyIdValue, this.postIdValue);
this.#refreshCheckmarkState();
} else {
_$('[data-fictioneer-id-param="login-modal"]')?.click();