-
-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy path1797-da08d4cb3423975e8aa6.js.map
1 lines (1 loc) · 1.67 KB
/
1797-da08d4cb3423975e8aa6.js.map
1
{"version":3,"file":"1797-da08d4cb3423975e8aa6.js","mappings":"uIAAA,i4C","sources":["webpack://embla-carousel-docs/./src/components/Sandbox/Vanilla/SandboxFilesDist/Thumbs/EmblaCarouselThumbsButton.js"],"sourcesContent":["export default \"\\nexport const addThumbBtnsClickHandlers = (emblaApiMain, emblaApiThumb) => {\\n const slidesThumbs = emblaApiThumb.slideNodes();\\n \\n const scrollToIndex = slidesThumbs.map((_, index) => () => emblaApiMain.scrollTo(index));\\n \\n slidesThumbs.forEach((slideNode, index) => {\\n slideNode.addEventListener('click', scrollToIndex[index], false);\\n });\\n \\n return () => {\\n slidesThumbs.forEach((slideNode, index) => {\\n slideNode.removeEventListener('click', scrollToIndex[index], false);\\n });\\n };\\n};\\n\\nexport const addToggleThumbBtnsActive = (emblaApiMain, emblaApiThumb) => {\\n const slidesThumbs = emblaApiThumb.slideNodes();\\n \\n const toggleThumbBtnsState = () => {\\n emblaApiThumb.scrollTo(emblaApiMain.selectedScrollSnap());\\n const previous = emblaApiMain.previousScrollSnap();\\n const selected = emblaApiMain.selectedScrollSnap();\\n slidesThumbs[previous].classList.remove('embla-thumbs__slide--selected');\\n slidesThumbs[selected].classList.add('embla-thumbs__slide--selected');\\n };\\n \\n emblaApiMain.on('select', toggleThumbBtnsState);\\n emblaApiThumb.on('init', toggleThumbBtnsState);\\n \\n return () => {\\n const selected = emblaApiMain.selectedScrollSnap();\\n slidesThumbs[selected].classList.remove('embla-thumbs__slide--selected');\\n };\\n};\\n\";"],"names":[],"sourceRoot":""}