Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_activeIdChanged(newValue) {
if (newValue) {
let el = null;
//ensure that this level is included
if (this.shadowRoot.querySelector('[data-id="' + newValue + '"]')) {
el = this.shadowRoot.querySelector('[data-id="' + newValue + '"]');
} else {
let tmpItem = store.manifest.items.find(i => i.id == newValue);
// fallback, maybe there's a child of this currently active
while (el === null && tmpItem && tmpItem.parent != null) {
// take the parent object of this current item
tmpItem = store.manifest.items.find(i => i.id == tmpItem.parent);
// see if IT lives in the dom, if not, keep going until we run out
if (
tmpItem &&
this.shadowRoot.querySelector('[data-id="' + tmpItem.id + '"]')
) {
el = this.shadowRoot.querySelector(
'[data-id="' + tmpItem.id + '"]'
);
}
}
}
if (this._prevEl) {
this._prevEl.classList.remove("active");
}
if (el) {
el.classList.add("active");
autorun(reaction => {
this.manifestItems = [...toJS(store.manifest.items)];
this.__disposer.push(reaction);
});
}
autorun(reaction => {
if (store.activeItem) {
this.activeGitFileLink =
varGet(store.manifest, "metadata.site.git.publicRepoUrl", "") +
store.activeItem.location;
}
this.__disposer.push(reaction);
});
}
autorun(reaction => {
this.manifest = toJS(store.manifest);
this.__disposer.push(reaction);
});
}
autorun(reaction => {
let manifest = toJS(store.manifest);
this.title = varGet(manifest, "title", "");
this.image = varGet(
manifest,
"metadata.theme.variables.image",
"assets/banner.jpg"
);
this.icon = varGet(
manifest,
"metadata.theme.variables.icon",
"icons:record-voice-over"
);
this.author = varGet(manifest, "metadata.author", {});
this.__disposer.push(reaction);
});
autorun(reaction => {
autorun(reaction => {
let manifest = toJS(store.manifest);
if (manifest && manifest.description) {
this.description = manifest.description;
}
if (manifest && manifest.title) {
this.title = manifest.title;
}
this.image = varGet(
manifest,
"metadata.theme.variables.image",
"assets/banner.jpg"
);
this.icon = varGet(
manifest,
"metadata.theme.variables.icon",
"icons:record-voice-over"
);
autorun(reaction => {
let manifest = toJS(store.manifest);
this.title = varGet(manifest, "title", "");
this.image = varGet(
manifest,
"metadata.theme.variables.image",
"assets/banner.jpg"
);
this.icon = varGet(
manifest,
"metadata.theme.variables.icon",
"icons:record-voice-over"
);
this.author = varGet(manifest, "metadata.author", {});
this.__disposer.push(reaction);
});
autorun(reaction => {
autorun(reaction => {
this.manifest = toJS(store.manifest);
this.__disposer.push(reaction);
});
autorun(reaction => {
autorun(reaction => {
this.manifest = toJS(store.manifest);
this.__disposer.push(reaction);
});
afterNextRender(this, function() {
autorun(reaction => {
this.manifest = toJS(store.manifest);
this.__disposer.push(reaction);
});
autorun(reaction => {