#69 : Rename showParticle -> showParticle

This commit is contained in:
Vadim
2021-10-03 12:13:06 +03:00
parent 858a5dc36b
commit 96ca49c7f4

View File

@@ -123,7 +123,7 @@
if (typeof pageIndex !== 'number') { if (typeof pageIndex !== 'number') {
throw new Error('pageIndex should be a number') throw new Error('pageIndex should be a number')
} }
await showPage(getParticleIndexByPageIndex({ await showParticle(getParticleIndexByPageIndex({
infinite, infinite,
pageIndex, pageIndex,
clonesCountHead: clonesCount.head, clonesCountHead: clonesCount.head,
@@ -304,7 +304,7 @@
}) })
async function handlePageChange(pageIndex) { async function handlePageChange(pageIndex) {
await showPage(getParticleIndexByPageIndex({ await showParticle(getParticleIndexByPageIndex({
infinite, infinite,
pageIndex, pageIndex,
clonesCountHead: clonesCount.head, clonesCountHead: clonesCount.head,
@@ -332,10 +332,10 @@
let jumped = false let jumped = false
if (infinite) { if (infinite) {
if (currentParticleIndex === 0) { if (currentParticleIndex === 0) {
await showPage(particlesCount - clonesCount.total, { animated: false }) await showParticle(particlesCount - clonesCount.total, { animated: false })
jumped = true jumped = true
} else if (currentParticleIndex === particlesCount - clonesCount.tail) { } else if (currentParticleIndex === particlesCount - clonesCount.tail) {
await showPage(clonesCount.head, { animated: false }) await showParticle(clonesCount.head, { animated: false })
jumped = true jumped = true
} }
} }
@@ -357,7 +357,7 @@
!jumped && applyAutoplayIfNeeded(autoplay) // no need to wait it finishes !jumped && applyAutoplayIfNeeded(autoplay) // no need to wait it finishes
} }
async function showPage(particleIndex, options) { async function showParticle(particleIndex, options) {
await changePage( await changePage(
() => store.moveToParticle({ () => store.moveToParticle({
particleIndex, particleIndex,
@@ -414,7 +414,7 @@
} }
function handleSwipeEnd() { function handleSwipeEnd() {
if (!swiping) return if (!swiping) return
showPage(currentParticleIndex) showParticle(currentParticleIndex)
} }
async function handleSwipeFailed() { async function handleSwipeFailed() {
if (!swiping) return if (!swiping) return