Fix large card checkmarks toggle
This commit is contained in:
parent
dfde0cc075
commit
f958cca073
2
js/application.min.js
vendored
2
js/application.min.js
vendored
File diff suppressed because one or more lines are too long
6
js/complete.min.js
vendored
6
js/complete.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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; ?>
|
||||
>
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user