Style and dialog WIP (#27)
Reviewed-on: https://codeberg.org/macchiato/pages/pulls/27file-group-page
parent
3bae81abeb
commit
e01fe8c5e6
@ -0,0 +1,32 @@
|
|||||||
|
export class Dialog extends HTMLElement {
|
||||||
|
constructor() {
|
||||||
|
super()
|
||||||
|
this.attachShadow({mode: 'open'})
|
||||||
|
this.windowEl = document.createElement('div')
|
||||||
|
this.windowEl.classList.add('window')
|
||||||
|
this.headerEl = document.createElement('div')
|
||||||
|
this.headerEl.classList.add('header')
|
||||||
|
this.bodyEl = document.createElement('div')
|
||||||
|
this.bodyEl.classList.add('body')
|
||||||
|
this.footerEl = document.createElement('div')
|
||||||
|
this.footerEl.classList.add('footer')
|
||||||
|
this.windowEl.replaceChildren(
|
||||||
|
this.headerEl, this.bodyEl, this.footerEl
|
||||||
|
)
|
||||||
|
this.shadowRoot.appendChild(this.windowEl)
|
||||||
|
}
|
||||||
|
|
||||||
|
connectedCallback() {
|
||||||
|
this.textArea.value = this.body
|
||||||
|
const style = document.createElement('style')
|
||||||
|
style.textContent = `
|
||||||
|
:host {
|
||||||
|
overflow-y: auto;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: stretch;
|
||||||
|
}
|
||||||
|
`
|
||||||
|
this.shadowRoot.append(style)
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue