|
|
|
@ -3,8 +3,8 @@ export class Layout extends HTMLElement {
|
|
|
|
super()
|
|
|
|
super()
|
|
|
|
this.attachShadow({mode: 'open'})
|
|
|
|
this.attachShadow({mode: 'open'})
|
|
|
|
this.csp = "default-src 'self' 'unsafe-inline' 'unsafe-eval'"
|
|
|
|
this.csp = "default-src 'self' 'unsafe-inline' 'unsafe-eval'"
|
|
|
|
this.editing = false
|
|
|
|
|
|
|
|
this.header = document.createElement('m-header')
|
|
|
|
this.header = document.createElement('m-header')
|
|
|
|
|
|
|
|
this.editing = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
connectedCallback() {
|
|
|
|
connectedCallback() {
|
|
|
|
@ -24,7 +24,6 @@ export class Layout extends HTMLElement {
|
|
|
|
this.header.editing = this.editing
|
|
|
|
this.header.editing = this.editing
|
|
|
|
this.header.addEventListener('click-edit', () => {
|
|
|
|
this.header.addEventListener('click-edit', () => {
|
|
|
|
this.editing = !this.editing
|
|
|
|
this.editing = !this.editing
|
|
|
|
this.header.editing = this.editing
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
this.shadowRoot.appendChild(this.header)
|
|
|
|
this.shadowRoot.appendChild(this.header)
|
|
|
|
this.load()
|
|
|
|
this.load()
|
|
|
|
@ -39,6 +38,7 @@ export class Layout extends HTMLElement {
|
|
|
|
this.page = document.createElement('m-page')
|
|
|
|
this.page = document.createElement('m-page')
|
|
|
|
this.page.csp = this.csp
|
|
|
|
this.page.csp = this.csp
|
|
|
|
this.page.path = path
|
|
|
|
this.page.path = path
|
|
|
|
|
|
|
|
this.editing = this.editing
|
|
|
|
if (prevPage !== undefined) {
|
|
|
|
if (prevPage !== undefined) {
|
|
|
|
prevPage.remove()
|
|
|
|
prevPage.remove()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -49,4 +49,16 @@ export class Layout extends HTMLElement {
|
|
|
|
get path() {
|
|
|
|
get path() {
|
|
|
|
return '/hello'
|
|
|
|
return '/hello'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set editing(value) {
|
|
|
|
|
|
|
|
this._editing = value
|
|
|
|
|
|
|
|
this.header.editing = this.editing
|
|
|
|
|
|
|
|
if (this.page) {
|
|
|
|
|
|
|
|
this.page.editing = this.editing
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get editing() {
|
|
|
|
|
|
|
|
return this._editing
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|