Commit 8c9cd339 authored by Fred Chasen's avatar Fred Chasen

Remove headers before layout

parent 91719097
......@@ -75,6 +75,7 @@ class Chunker {
this.styles = polisher;
this.breaks = this.styles && this.styles.breaks;
this.styles && this.styles.targetText(parsed);
this.styles && this.styles.removeHeaders(parsed);
let sections;
if (this.breaks) {
......@@ -202,7 +203,7 @@ class Chunker {
section.on("renderedPage", (page) => {
this.styles && this.styles.contents(page.element);
this.styles && this.styles.headers(page.element);
this.styles && this.styles.pageHeaders(page.element);
this.emit("renderedPage", page);
})
......
......@@ -150,7 +150,21 @@ class Polisher {
});
}
headers(fragment) {
removeHeaders(fragment) {
for (let name of Object.keys(this.running)) {
let set = this.running[name];
let selected = Array.from(fragment.querySelectorAll(set.selector));
if (set.identifier === "running") {
for (let header of selected) {
header.style.display = "none";
}
}
}
}
pageHeaders(fragment) {
for (let name of Object.keys(this.running)) {
let set = this.running[name];
let selected = fragment.querySelector(set.selector);
......@@ -161,7 +175,6 @@ class Polisher {
// this.styleSheet.insertRule(`:root { --string-${name}: "${cssVar}"; }`, this.styleSheet.cssRules.length);
// fragment.style.setProperty(`--string-${name}`, `"${cssVar}"`);
set.first = selected;
selected.style.display = "none";
} else {
console.log(set.value + "needs css replacement");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment