From aa52abb7a82562aec6d1ff7078c0efbab239b87f Mon Sep 17 00:00:00 2001 From: Vadim Date: Thu, 15 Jul 2021 19:40:08 +0300 Subject: [PATCH] #31 : Rename applyAutoplay -> applyAutoplayIfNeeded --- src/components/Carousel/Carousel.svelte | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Carousel/Carousel.svelte b/src/components/Carousel/Carousel.svelte index b0f8437..886a94e 100644 --- a/src/components/Carousel/Carousel.svelte +++ b/src/components/Carousel/Carousel.svelte @@ -169,7 +169,7 @@ pagesElement.append(first.cloneNode(true)) } - function applyAutoplay(options) { + function applyAutoplayIfNeeded(options) { // prevent progress change if not infinite for first and last page if ( !infinite && ( @@ -211,7 +211,7 @@ applyPageSizes() } - applyAutoplay() + applyAutoplayIfNeeded() addResizeEventListener(applyPageSizes) })() @@ -269,7 +269,7 @@ setTimeout(() => { offsetPage(animated) const jumped = jumpIfNeeded() - !jumped && applyAutoplay({ delaysMs: _duration }) + !jumped && applyAutoplayIfNeeded({ delaysMs: _duration }) }, offsetDelayMs) }, { animated }) } @@ -279,7 +279,7 @@ store.prev({ infinite, pagesCount }) offsetPage(animated) const jumped = jumpIfNeeded() - !jumped && applyAutoplay({ delaysMs: _duration }) + !jumped && applyAutoplayIfNeeded({ delaysMs: _duration }) }, { animated }) } function showNextPage(options) { @@ -288,7 +288,7 @@ store.next({ infinite, pagesCount }) offsetPage(animated) const jumped = jumpIfNeeded() - !jumped && applyAutoplay({ delaysMs: _duration }) + !jumped && applyAutoplayIfNeeded({ delaysMs: _duration }) }, { animated }) }