Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
})
.then(function(response) {
let indent = result[i].indent + 1;
if (indent > 6) {
indent = 6;
}
return `${result[i].title}
${response}`;
});
}
} else if (type === "ancestor") {
// everything from highest parent
const result = store.computeItems(
1,
100,
store.activeId,
"ancestor",
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) {
let indent = result[i].indent + 1;
if (indent > 6) {
indent = 6;
}
return `${result[i].title}
${response}`;
_locationChanged(newValue, oldValue) {
if (!newValue || typeof newValue.route === "undefined") return;
const location = newValue;
const name = location.route.name;
if (name == "home" || name == "404") {
// if we are on the homepage then load the first item in the manifest
// and set it active
const firstItem = store.routerManifest.items.find(
i => typeof i.id !== "undefined"
);
if (firstItem) {
store.activeId = firstItem.id;
}
}
if (this.HAXCMSThemeSettings.autoScroll) {
window.scrollTo({
top: 0,
left: 0
});
}
}
/**
_goBack(e) {
const prevActiveItemId = store.activeId;
window.history.pushState(null, null, store.location.baseUrl);
window.dispatchEvent(new PopStateEvent("popstate"));
// should help account for starting on a page where popstate isn't set
// and also generate data model mirroring
if (prevActiveItemId) {
setTimeout(() => {
let active = this.shadowRoot
.querySelector("simple-blog-listing")
.shadowRoot.querySelector(
'simple-blog-overview[item-id="' + prevActiveItemId + '"]'
);
if (active) {
active.scrollIntoView(true);
active.focus();
}
}, 100);
autorun(reaction => {
this.activeId = toJS(store.activeId);
this.__disposer.push(reaction);
});
}
autorun(reaction => {
this.parent = toJS(store.activeId);
this.__disposer.push(reaction);
});
}
this.__disposer = autorun(() => {
this.activeId = toJS(store.activeId);
});
}, 50);
autorun(reaction => {
this.activeId = toJS(store.activeId);
this.__disposer.push(reaction);
});
autorun(reaction => {
this.__disposer2 = autorun(() => {
this.activeId = toJS(store.activeId);
});
}, 50);
autorun(reaction => {
this.activeId = toJS(store.activeId);
this.__disposer.push(reaction);
});
if (this.scrollOnActive) {
autorun(reaction => {
this.activeId = toJS(store.activeId);
this.__disposer.push(reaction);
});
}