Skip to content

Commit

Permalink
style: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ismail9k committed Dec 11, 2024
1 parent 9d0d56f commit a32c9a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions src/components/Carousel/Carousel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,12 @@ export const Carousel = defineComponent({

const setAnimationInterval = (event: AnimationEvent) => {
const target = event.target as HTMLElement
if (!target?.contains(root.value) || Array.isArray(ignoreAnimations.value) && ignoreAnimations.value.includes(event.animationName)) {
return;
if (
!target?.contains(root.value) ||
(Array.isArray(ignoreAnimations.value) &&
ignoreAnimations.value.includes(event.animationName))
) {
return
}

transformElements.add(target)
Expand All @@ -250,10 +254,9 @@ export const Carousel = defineComponent({
}
}


const mounted = ref(false)

if (typeof document !== "undefined") {
if (typeof document !== 'undefined') {
watchEffect(() => {
if (mounted.value && ignoreAnimations.value !== false) {
document.addEventListener('animationstart', setAnimationInterval)
Expand Down Expand Up @@ -301,7 +304,7 @@ export const Carousel = defineComponent({
resizeObserver = null
}

if (typeof document !== "undefined") {
if (typeof document !== 'undefined') {
handleBlur()
}
if (root.value) {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ export interface CarouselConfig {
ignoreAnimations: boolean | string[] | string
}

export type VueClass = string | Record<string, boolean> | VueClass[];
export type VueClass = string | Record<string, boolean> | VueClass[]

0 comments on commit a32c9a6

Please sign in to comment.