Skip to content

Commit a098cf2

Browse files
Drop selector for content-wrapper
1 parent 112d2da commit a098cf2

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

assets/js/shortcuts.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,7 @@ function setupShortcuts(shortcutDepth = 2) {
9898

9999
shortcutDepth += 1; // to account for the page title
100100

101-
/*
102-
* Build selectors for both patterns:
103-
* 1. Direct children of .content-container (for headers directly in the container)
104-
* 2. Headers within wrappers inside .content-container (for when content-wrapper is used)
105-
*
106-
* This works with both DOM structures we might encounter, whether the templates
107-
* have been updated to use content-wrapper or not (just in case).
108-
*/
101+
// Build a class selector for each header type, and concatenate with commas
109102
let classes = "";
110103
for (let i = 2; i <= shortcutDepth; i++) {
111104
if (i != 2) {
@@ -114,10 +107,6 @@ function setupShortcuts(shortcutDepth = 2) {
114107
classes += " .content-container > h" + i;
115108
}
116109

117-
for (let i = 2; i <= shortcutDepth; i++) {
118-
classes += ", .content-wrapper > h" + i;
119-
}
120-
121110
const classElements = Array.from(document.querySelectorAll(classes));
122111

123112
// Only proceed if we found headers (to avoid creating an empty shortcuts section)

0 commit comments

Comments
 (0)