mirror of https://github.com/docusealco/docuseal
				
				
				
			
							parent
							
								
									6f7b9b1ebf
								
							
						
					
					
						commit
						708b8afdf5
					
				| @ -1,14 +1,12 @@ | ||||
| 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) | ||||
|     const image = this.querySelector('img') | ||||
| 
 | ||||
|     image.addEventListener('load', (e) => { | ||||
|       image.setAttribute('width', e.target.naturalWidth) | ||||
|       image.setAttribute('height', e.target.naturalHeight) | ||||
| 
 | ||||
|       this.style.aspectRatio = `${e.target.naturalWidth} / ${e.target.naturalHeight}` | ||||
|     }) | ||||
|   } | ||||
| 
 | ||||
|   get image () { | ||||
|     return this.querySelector('img') | ||||
|   } | ||||
| } | ||||
|  | ||||
					Loading…
					
					
				
		Reference in new issue