Toggle editing

file-group-page
bat 3 years ago
parent 5ae07be15d
commit d597db2258

@ -3,6 +3,12 @@ export class Layout extends HTMLElement {
super() super()
this.attachShadow({mode: 'open'}) this.attachShadow({mode: 'open'})
this.header = document.createElement('m-header') this.header = document.createElement('m-header')
this.editing = false
this.header.editing = this.editing
this.header.addEventListener('click-edit', () => {
this.editing = !this.editing
this.header.editing = this.editing
})
this.shadowRoot.appendChild(this.header) this.shadowRoot.appendChild(this.header)
this.load() this.load()
addEventListener('hashchange', () => { addEventListener('hashchange', () => {
@ -39,9 +45,6 @@ export class Layout extends HTMLElement {
} }
get path() { get path() {
return new URL( return '/hello'
window.location.hash.slice(1) || '/',
window.location
).pathname
} }
} }
Loading…
Cancel
Save