1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-08-09 02:36:40 +02:00

Add beginner version of frontend roadmap

This commit is contained in:
Kamran Ahmed
2023-03-02 19:19:34 +00:00
parent 01c090f62d
commit cb32a9610d
3 changed files with 12 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -5,7 +5,7 @@ export class Renderer {
this.resourceId = '';
this.resourceType = '';
this.jsonUrl = '';
this.loaderNode = null;
this.loaderHTML = null;
this.containerId = 'resource-svg-wrap';
this.loaderId = 'resource-loader';
@@ -31,7 +31,7 @@ export class Renderer {
}
// Clone it so we can use it later
this.loaderNode = this.loaderEl.cloneNode();
this.loaderHTML = this.loaderEl.innerHTML;
const dataset = this.containerEl.dataset;
this.resourceType = dataset.resourceType;
@@ -51,7 +51,7 @@ export class Renderer {
return null;
}
this.containerEl.replaceChildren(this.loaderNode);
this.containerEl.innerHTML = this.loaderHTML;
return fetch(jsonUrl)
.then((res) => {
@@ -100,6 +100,13 @@ export class Renderer {
return;
}
if (/^json:/.test(groupId)) {
this.jsonToSvg(groupId.replace('json:', '')).then(() => {
this.containerEl.setAttribute('style', '');
});
return;
}
if (/^check:/.test(groupId)) {
window.dispatchEvent(
new CustomEvent(`${this.resourceType}.topic.toggle`, {