embla-carousel-auto-height
Advanced tools
Comparing version 8.0.0-rc03 to 8.0.0-rc04
@@ -11,3 +11,3 @@ 'use strict'; | ||
let options; | ||
let carousel; | ||
let emblaApi; | ||
let slideBounds = []; | ||
@@ -17,4 +17,4 @@ let slideHeights = []; | ||
const inViewThreshold = 0.5; | ||
function init(embla, optionsHandler) { | ||
carousel = embla; | ||
function init(emblaApiInstance, optionsHandler) { | ||
emblaApi = emblaApiInstance; | ||
const { | ||
@@ -33,11 +33,11 @@ mergeOptions, | ||
slideRects | ||
} = carousel.internalEngine(); | ||
} = emblaApi.internalEngine(); | ||
if (axis === 'y') return; | ||
slideBounds = slidesInView.findSlideBounds(undefined, inViewThreshold); | ||
slideHeights = slideRects.map(rect => rect.height); | ||
heightEvents.forEach(evt => carousel.on(evt, setContainerHeight)); | ||
heightEvents.forEach(evt => emblaApi.on(evt, setContainerHeight)); | ||
setContainerHeight(); | ||
} | ||
function destroy() { | ||
heightEvents.forEach(evt => carousel.off(evt, setContainerHeight)); | ||
heightEvents.forEach(evt => emblaApi.off(evt, setContainerHeight)); | ||
setContainerHeight(undefined, 'destroy'); | ||
@@ -49,3 +49,3 @@ } | ||
target | ||
} = carousel.internalEngine(); | ||
} = emblaApi.internalEngine(); | ||
const inViewIndexes = slidesInView.check(target.get(), slideBounds); | ||
@@ -57,3 +57,3 @@ const heights = inViewIndexes.map(index => slideHeights[index]); | ||
const height = evt === 'destroy' ? options.destroyHeight : `${highestInView()}px`; | ||
carousel.containerNode().style.height = height; | ||
emblaApi.containerNode().style.height = height; | ||
} | ||
@@ -60,0 +60,0 @@ const self = { |
@@ -9,3 +9,3 @@ const defaultOptions = { | ||
let options; | ||
let carousel; | ||
let emblaApi; | ||
let slideBounds = []; | ||
@@ -15,4 +15,4 @@ let slideHeights = []; | ||
const inViewThreshold = 0.5; | ||
function init(embla, optionsHandler) { | ||
carousel = embla; | ||
function init(emblaApiInstance, optionsHandler) { | ||
emblaApi = emblaApiInstance; | ||
const { | ||
@@ -31,11 +31,11 @@ mergeOptions, | ||
slideRects | ||
} = carousel.internalEngine(); | ||
} = emblaApi.internalEngine(); | ||
if (axis === 'y') return; | ||
slideBounds = slidesInView.findSlideBounds(undefined, inViewThreshold); | ||
slideHeights = slideRects.map(rect => rect.height); | ||
heightEvents.forEach(evt => carousel.on(evt, setContainerHeight)); | ||
heightEvents.forEach(evt => emblaApi.on(evt, setContainerHeight)); | ||
setContainerHeight(); | ||
} | ||
function destroy() { | ||
heightEvents.forEach(evt => carousel.off(evt, setContainerHeight)); | ||
heightEvents.forEach(evt => emblaApi.off(evt, setContainerHeight)); | ||
setContainerHeight(undefined, 'destroy'); | ||
@@ -47,3 +47,3 @@ } | ||
target | ||
} = carousel.internalEngine(); | ||
} = emblaApi.internalEngine(); | ||
const inViewIndexes = slidesInView.check(target.get(), slideBounds); | ||
@@ -55,3 +55,3 @@ const heights = inViewIndexes.map(index => slideHeights[index]); | ||
const height = evt === 'destroy' ? options.destroyHeight : `${highestInView()}px`; | ||
carousel.containerNode().style.height = height; | ||
emblaApi.containerNode().style.height = height; | ||
} | ||
@@ -58,0 +58,0 @@ const self = { |
{ | ||
"name": "embla-carousel-auto-height", | ||
"version": "8.0.0-rc03", | ||
"version": "8.0.0-rc04", | ||
"author": "David Jerleke", | ||
@@ -58,4 +58,4 @@ "description": "An auto height plugin for Embla Carousel", | ||
"peerDependencies": { | ||
"embla-carousel": "8.0.0-rc03" | ||
"embla-carousel": "8.0.0-rc04" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10121