Skip to content

Commit dd8116c

Browse files
committed
prettier fixes
1 parent 2a6e454 commit dd8116c

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

src/Elastic.Documentation.Site/Assets/image-carousel.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ class ImageCarousel {
1818
this.slides = Array.from(
1919
this.container.querySelectorAll('.carousel-slide')
2020
)
21-
21+
2222
// Don't initialize if no slides
2323
if (this.slides.length === 0) {
2424
console.warn('No carousel slides found')
2525
return
2626
}
27-
27+
2828
this.indicators = Array.from(
2929
this.container.querySelectorAll('.carousel-indicator')
3030
)
@@ -69,7 +69,7 @@ class ImageCarousel {
6969
})
7070

7171
// Handle image clicks for modal
72-
this.slides.forEach(slide => {
72+
this.slides.forEach((slide) => {
7373
const imageLink = slide.querySelector('.carousel-image-reference')
7474
if (imageLink) {
7575
imageLink.addEventListener('click', (e) => {
@@ -168,7 +168,7 @@ class ImageCarousel {
168168
}
169169
}
170170

171-
images.forEach(img => {
171+
images.forEach((img) => {
172172
if (img.complete) {
173173
positionAfterLoad()
174174
} else {
@@ -185,7 +185,7 @@ class ImageCarousel {
185185
let minHeight = Infinity
186186

187187
// Find the smallest image height among all images
188-
images.forEach(img => {
188+
images.forEach((img) => {
189189
const height = img.offsetHeight
190190
if (height > 0 && height < minHeight) {
191191
minHeight = height
@@ -198,14 +198,19 @@ class ImageCarousel {
198198
const fortyPercentHeight = Math.floor(minHeight * 0.4)
199199
const minTop = 50 // Minimum 50px from top
200200
const maxTop = Math.floor(minHeight * 0.8) // Maximum 80% down the smallest image
201-
202-
const controlTop = Math.max(minTop, Math.min(fortyPercentHeight, maxTop))
203-
201+
202+
const controlTop = Math.max(
203+
minTop,
204+
Math.min(fortyPercentHeight, maxTop)
205+
)
206+
204207
this.prevButton.style.top = `${controlTop}px`
205208
this.nextButton.style.top = `${controlTop}px`
206-
209+
207210
// Debug logging (remove in production)
208-
console.log(`Carousel controls positioned: minHeight=${minHeight}px, controlTop=${controlTop}px`)
211+
console.log(
212+
`Carousel controls positioned: minHeight=${minHeight}px, controlTop=${controlTop}px`
213+
)
209214
}
210215
}
211216
}

0 commit comments

Comments
 (0)