-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
James Goldie
committed
Sep 24, 2024
1 parent
a9bdd06
commit d5583d1
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,6 @@ contributes: | |
page-layout: full | ||
execute: | ||
echo: false | ||
|
||
include-after-body: | ||
file: | ||
protect-stickies.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<script id="closeread-exclude-from-quarto-grid" type="application/javascript"> | ||
|
||
// remove .column-* and other classes from elements inside .cr-section | ||
window.document.addEventListener("DOMContentLoaded", function (event) { | ||
|
||
// remove .page-columns and .page-full from .c-section itself | ||
const crSections = window.document.querySelectorAll(".cr-section"); | ||
|
||
crSections.forEach(el => { | ||
console.log("Removing classes from .cr-section..."); | ||
el.classList.remove("page-full", "page-columns"); | ||
}); | ||
|
||
console.log("Looking for offending .column-* or .page-columns inside .cr-section...") | ||
|
||
const allColumnEls = | ||
window.document.querySelectorAll( | ||
".cr-section .page-columns, .cr-section .column-screen"); | ||
|
||
allColumnEls.forEach(el => { | ||
const badClasses = | ||
[...el.classList].filter(c => c.startsWith("column-")); | ||
console.log("Removing classes from el: ", badClasses) | ||
el.classList.remove("page-full", "page-columns", ...badClasses); | ||
}); | ||
|
||
|
||
// TODO - what we do about about ancestors between .cr-section and main | ||
// that have also been affected? no way to know whether they were supposed | ||
// to get them... | ||
|
||
}); | ||
</script> |