* @param {string | HTMLElement} html
(html)
| 72 | * @param {string | HTMLElement} html |
| 73 | */ |
| 74 | populate(html) { |
| 75 | this.contentEl.replaceChildren(html); |
| 76 | this.loaderEl.classList.add('hidden'); |
| 77 | this.topicActionsEl.classList.remove('hidden'); |
| 78 | |
| 79 | const normalizedGroup = (this.activeTopicId || '').replace(/^\d+-/, ''); |
| 80 | const isDone = localStorage.getItem(normalizedGroup) === 'done'; |
| 81 | |
| 82 | if (isDone) { |
| 83 | this.markTopicDoneEl.classList.add('hidden'); |
| 84 | this.markTopicPendingEl.classList.remove('hidden'); |
| 85 | } else { |
| 86 | this.markTopicDoneEl.classList.remove('hidden'); |
| 87 | this.markTopicPendingEl.classList.add('hidden'); |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | fetchTopicHtml(roadmapId, topicId) { |
| 92 | const topicPartial = topicId.replace(/^\d+-/, '').replaceAll(/:/g, '/'); |