Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #306 from serlo/patch2
Browse files Browse the repository at this point in the history
refactor: Use generics in edusharing-asset/renderer.tsx
  • Loading branch information
kulla authored Dec 21, 2023
2 parents dbe39c4 + fbe4c80 commit eb0a71f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/frontend/plugins/edusharing-asset/renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function EdusharingAssetRenderer(props: {
const parser = new DOMParser()
let document = parser.parseFromString(embedHtml, 'text/html')

const contentWrapperElement = document.querySelector(
const contentWrapperElement = document.querySelector<HTMLDivElement>(
'.edusharing_rendering_content_wrapper',
)

Expand All @@ -85,7 +85,7 @@ export function EdusharingAssetRenderer(props: {
contentWrapperElement.style.width = ''
}

const imgElement = document.querySelector(
const imgElement = document.querySelector<HTMLImageElement>(
'.edusharing_rendering_content_wrapper > img',
)

Expand All @@ -96,7 +96,9 @@ export function EdusharingAssetRenderer(props: {
imgElement.style.width = ''
}

const videoElement = document.querySelector('.videoWrapperInner > video')
const videoElement = document.querySelector<HTMLVideoElement>(
'.videoWrapperInner > video',
)

if (videoElement) {
videoElement.style.height = `${height}rem`
Expand Down

1 comment on commit eb0a71f

@vercel
Copy link

@vercel vercel bot commented on eb0a71f Dec 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.