-
-
Notifications
You must be signed in to change notification settings - Fork 193
/
3165-08b551db385c3e4eb000.js.map
1 lines (1 loc) · 2.08 KB
/
3165-08b551db385c3e4eb000.js.map
1
{"version":3,"file":"3165-08b551db385c3e4eb000.js","mappings":"uIAAA,qxD","sources":["webpack://embla-carousel-docs/./src/components/Sandbox/Vanilla/SandboxFilesDist/AutoScroll/EmblaCarouselAutoScroll.js"],"sourcesContent":["export default \"\\nexport const addPlayBtnListeners = (emblaApi, playBtn) => {\\n const togglePlayBtnState = (emblaApi) => {\\n const autoScroll = emblaApi?.plugins()?.autoScroll;\\n if (!autoScroll)\\n return;\\n \\n const buttonText = autoScroll.isPlaying() ? 'Start' : 'Stop';\\n playBtn.innerHTML = buttonText;\\n };\\n \\n const onPlayBtnClick = () => {\\n const autoScroll = emblaApi?.plugins()?.autoScroll;\\n if (!autoScroll)\\n return;\\n \\n const playOrStop = autoScroll.isPlaying()\\n ? autoScroll.stop\\n : autoScroll.play;\\n playOrStop();\\n };\\n \\n playBtn.addEventListener('click', onPlayBtnClick);\\n emblaApi\\n .on('autoScroll:play', togglePlayBtnState)\\n .on('autoScroll:stop', togglePlayBtnState)\\n .on('reInit', togglePlayBtnState);\\n \\n return () => {\\n playBtn.removeEventListener('click', onPlayBtnClick);\\n emblaApi\\n .off('autoScroll:play', togglePlayBtnState)\\n .off('autoScroll:stop', togglePlayBtnState)\\n .off('reInit', togglePlayBtnState);\\n };\\n};\\n\\nexport const addNavBtnListeners = (emblaApi, ...navButtons) => {\\n const onNavClick = () => {\\n const autoScroll = emblaApi?.plugins()?.autoScroll;\\n if (!autoScroll)\\n return;\\n \\n const resetOrStop = autoScroll.options.stopOnInteraction === false\\n ? autoScroll.reset\\n : autoScroll.stop;\\n \\n resetOrStop();\\n };\\n \\n navButtons.forEach((navButton) => navButton.addEventListener('click', onNavClick, true));\\n \\n return () => {\\n navButtons.forEach((navButton) => navButton.removeEventListener('click', onNavClick, true));\\n };\\n};\\n\";"],"names":[],"sourceRoot":""}