removed home icon

This commit is contained in:
rafapaezbas
2024-01-24 15:56:31 +01:00
parent c1035ff079
commit fda84dcd39
2 changed files with 5 additions and 21 deletions

View File

@@ -52,14 +52,10 @@ customElements.define('docs-viewer', class extends HTMLElement {
this.panel = this.root.querySelector('#panel')
this.home = document.querySelector('#home')
this.status = document.querySelector('#status')
this.page = '/readme.md'
this.home.style.display = 'none'
const observer = new MutationObserver(() => {
if (document.documentElement.classList.contains('light')) this.panel.classList.add('light')
else this.panel.classList.remove('light')
@@ -90,12 +86,15 @@ customElements.define('docs-viewer', class extends HTMLElement {
const docsViewer = document.querySelector('docs-viewer')
await docsViewer.load('/readme.md')
}
if (targetUrl.hash === '#status') {
this.panel.style.display = 'none'
this.status.style.display = ''
}
})
window.addEventListener('popstate', async (evt) => {
console.log(evt)
if (evt.state === null) {
this.home.style.display = 'none'
this.panel.style.display = 'none'
this.status.style.display = ''
return
@@ -117,7 +116,6 @@ customElements.define('docs-viewer', class extends HTMLElement {
const html = await fetch(page)
const text = await marked.parse(await html.text())
this.panel.querySelector('slot').innerHTML = text, { headerIds: false, mangle: false }
this.home.style.display = ''
this.panel.style.display = ''
this.status.style.display = 'none'
if (!opts.back) history.pushState({ page }, null)