Skip to content

Commit a42c554

Browse files
committed
scope selectors inside slide container
Signed-off-by: Prajwol Amatya <prajwolamatya11@gmail.com>
1 parent 306f108 commit a42c554

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/App.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,8 @@ function addCustomSlideNumber() {
246246
}
247247
}
248248
function updateImageStructure() {
249-
const slideContainer = document.getElementById('slideContainer')
250-
if (!slideContainer) return
251-
const pTags = slideContainer.querySelectorAll('section p > img')
249+
if (!slideContainer.value) return
250+
const pTags = slideContainer.value.querySelectorAll('section p > img')
252251
pTags.forEach((img) => {
253252
const pTag = img.parentNode
254253
const divContainer = document.createElement('div')
@@ -350,7 +349,7 @@ function adjustFontSize() {
350349
}
351350
}
352351
function fitContent() {
353-
const images = document.querySelectorAll('img')
352+
const images = slideContainer.value.querySelectorAll('img')
354353
let imagesLoaded = 0
355354
356355
images.forEach((img) => {
@@ -378,7 +377,7 @@ function getFrontMatterFromMarkdown() {
378377
function setFontColor() {
379378
const frontMatter = getFrontMatterFromMarkdown()
380379
const color = frontMatter.metadata.color
381-
document.querySelectorAll('.title p, h1').forEach((el) => {
380+
slideContainer.value.querySelectorAll('.title p, h1').forEach((el) => {
382381
el.style.color = color
383382
})
384383
}
@@ -395,7 +394,7 @@ async function updateLogoUrl() {
395394
if (frontMatter.metadata?.logo) {
396395
const newLogoUrl = await updateImageUrls(frontMatter.metadata.logo)
397396
await nextTick()
398-
const imgs = document.querySelectorAll('.logo img')
397+
const imgs = slideContainer.value.querySelectorAll('.logo img')
399398
imgs.forEach((img) => {
400399
img.src = newLogoUrl
401400
})

0 commit comments

Comments
 (0)