mirror of
https://github.com/docusealco/docuseal.git
synced 2026-06-23 04:10:11 +00:00
15 lines
402 B
JavaScript
15 lines
402 B
JavaScript
export default class extends HTMLElement {
|
|
connectedCallback () {
|
|
this.image.addEventListener('load', (e) => {
|
|
this.image.setAttribute('width', e.target.naturalWidth)
|
|
this.image.setAttribute('height', e.target.naturalHeight)
|
|
|
|
this.style.aspectRatio = `${e.target.naturalWidth} / ${e.target.naturalHeight}`
|
|
})
|
|
}
|
|
|
|
get image () {
|
|
return this.querySelector('img')
|
|
}
|
|
}
|