-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from kunwarsaluja/baw_videotext
minor css change to account for metablock style and js change for ele…
- Loading branch information
Showing
2 changed files
with
16 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
export default function decorate(block) { | ||
[...block.children].forEach((row) => { | ||
const videoEl = [...row.children][0]; | ||
videoEl.classList.add('videocontent'); | ||
export default function decorate($block) { | ||
[...$block.children].forEach((row) => { | ||
const $videoEl = [...row.children][0]; | ||
$videoEl.classList.add('videocontent'); | ||
const videoURL = videoEl.innerHTML; | ||
videoEl.innerHTML = /* html */ | ||
$videoEl.innerHTML = /* html */ | ||
`<video playsinline controls name="media"><source src="${videoURL}" type="video/mp4"></video>`; | ||
const textEl = [...row.children][1]; | ||
textEl.classList.add('text'); | ||
textEl.querySelectorAll('a').forEach((a) => { | ||
a.target="_blank"; | ||
const $textEl = [...row.children][1]; | ||
$textEl.classList.add('text'); | ||
$textEl.querySelectorAll('a').forEach(($a) => { | ||
$a.target="_blank"; | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters