@skeletonlabs/skeleton 2.0.0-dev.50b73f0b → 2.0.0-dev.8046dd04
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,16 +6,16 @@ export function tocCrawler(node, args) {
|
|
|
6
6
|
let headings;
|
|
7
7
|
let permalinks = [];
|
|
8
8
|
function init() {
|
|
9
|
-
// Reset headings
|
|
10
|
-
headings = node.querySelectorAll(queryElements);
|
|
11
|
-
// Reset the permalinks array:
|
|
12
|
-
permalinks = [];
|
|
13
9
|
// Set accepted list of query elements
|
|
10
|
+
// (IMPORTANT: must proceed resetting `headings` below)
|
|
14
11
|
if (args?.queryElements)
|
|
15
12
|
queryElements = args.queryElements;
|
|
16
13
|
// Set the desired scroll target to monitor
|
|
17
14
|
if (args?.scrollTarget)
|
|
18
15
|
scrollTarget = args.scrollTarget;
|
|
16
|
+
// Reset local values
|
|
17
|
+
headings = node.querySelectorAll(queryElements);
|
|
18
|
+
permalinks = [];
|
|
19
19
|
// Query and process the headings
|
|
20
20
|
queryHeadings();
|
|
21
21
|
}
|