Remove chapter-list-data script after setup
This commit is contained in:
parent
eb988ac551
commit
6249bdd605
2
js/chapter.min.js
vendored
2
js/chapter.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
@ -90,7 +90,7 @@ get_header(
|
||||
);
|
||||
|
||||
if ( $story_post && $indexed_chapters ) {
|
||||
echo '<script>const fcn_storyChapterListData = ' . json_encode( fictioneer_get_chapter_index_array( $story_id ) ) . ';</script>';
|
||||
echo '<script id="chapter-list-data">const fcn_storyChapterListData = ' . json_encode( fictioneer_get_chapter_index_array( $story_id ) ) . ';</script>';
|
||||
}
|
||||
|
||||
if ( get_option( 'fictioneer_enable_bookmarks' ) ) {
|
||||
|
@ -1268,6 +1268,7 @@ function fcn_appendChapterList(target) {
|
||||
}
|
||||
|
||||
target.querySelector(`[data-id="${target.dataset.currentId}"]`)?.classList.add('current-chapter');
|
||||
document.getElementById("chapter-list-data")?.remove(); // Cleanup
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user