Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setTimeout(() => {
if (this.childNodes.length === 0) {
let frag = document
.createRange()
.createContextualFragment(store.activeItemContent);
this.appendChild(frag);
}
this.__styleReapply();
}, 50);
// keep editMode in sync globally
async print(e) {
// now dynamic import the footer so we don't bloat all other page loads
import("@lrnwebcomponents/haxcms-elements/lib/ui-components/layout/site-footer.js");
const type = this.type;
let content = "";
if (type === "page") {
// oh there you are
content = `
<h1>${store.activeItem.title}</h1>
<div>${store.activeItemContent}</div>`;
} else if (type === "parent") {
// everything from the parent of this page, down
const result = store.computeItems(
1,
100,
store.activeId,
"parent",
store.routerManifest,
true
);
for (var i in result) {
content += await fetch("pages/" + result[i].location + "/index.html")
.then(function(response) {
return response.text();
})
.then(function(response) {