mirror of
https://github.com/aljazceru/pear-docs.git
synced 2025-12-17 14:34:19 +01:00
removed home icon
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user