Skip to content

Commit

Permalink
fix(playground): only show for js,css,html (#10338)
Browse files Browse the repository at this point in the history
Only add the play and queue button to js, css and html code blocks.
  • Loading branch information
fiji-flo authored Jan 18, 2024
1 parent 7bb1681 commit f7144aa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions client/src/document/code/playground.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ export function addCollectButton(
return;
}
if (!element || element.querySelector(".play-button")) return;
if (
[...(element.nextElementSibling?.classList.values() || [])].filter((c) =>
["js", "javascript", "css", "html"].includes(c)
).length === 0
) {
return;
}
const checkId = crypto.randomUUID();
const playlist = document.createElement("div");
playlist.classList.add("playlist");
Expand Down

0 comments on commit f7144aa

Please sign in to comment.