Skip to content

Commit

Permalink
Only apply layout to direct .cr-section parents
Browse files Browse the repository at this point in the history
  • Loading branch information
James Goldie committed Oct 18, 2024
1 parent f1eb9b2 commit c9c6a9b
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions _extensions/closeread/closeread.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,10 @@ document.addEventListener("DOMContentLoaded", () => {
/* this replicates quarto <= 1.6 functionality:
https://github.com/quarto-dev/quarto-cli/blob/
d85467627aae71c96e3d1e9718a3b47289329cde/src/format/html/
format-html-bootstrap.ts#L1163C1-L1186C7 */
const ensureInGrid = el => {
const parent = el.parentElement
parent.classList.add("page-columns", "page-full")
if (isDocumentMain(parent)) {
return
} else {
ensureInGrid(parent)
}
}
format-html-bootstrap.ts#L1163C1-L1186C7 */
const crSections = Array.from(document.querySelectorAll(".cr-section"))
crSections.map(ensureInGrid)
crSections.map(
el => el.parentElement.classList.add("page-columns", "page-full"))

const ojsModule = window._ojs?.ojsConnector?.mainModule
const ojsStickyName = ojsModule?.variable()
Expand Down

0 comments on commit c9c6a9b

Please # to comment.