|
123 | 123 | if (typeof pageIndex !== 'number') { |
124 | 124 | throw new Error('pageIndex should be a number') |
125 | 125 | } |
126 | | - await showPage(getParticleIndexByPageIndex({ |
| 126 | + await showParticle(getParticleIndexByPageIndex({ |
127 | 127 | infinite, |
128 | 128 | pageIndex, |
129 | 129 | clonesCountHead: clonesCount.head, |
|
304 | 304 | }) |
305 | 305 |
|
306 | 306 | async function handlePageChange(pageIndex) { |
307 | | - await showPage(getParticleIndexByPageIndex({ |
| 307 | + await showParticle(getParticleIndexByPageIndex({ |
308 | 308 | infinite, |
309 | 309 | pageIndex, |
310 | 310 | clonesCountHead: clonesCount.head, |
|
332 | 332 | let jumped = false |
333 | 333 | if (infinite) { |
334 | 334 | if (currentParticleIndex === 0) { |
335 | | - await showPage(particlesCount - clonesCount.total, { animated: false }) |
| 335 | + await showParticle(particlesCount - clonesCount.total, { animated: false }) |
336 | 336 | jumped = true |
337 | 337 | } else if (currentParticleIndex === particlesCount - clonesCount.tail) { |
338 | | - await showPage(clonesCount.head, { animated: false }) |
| 338 | + await showParticle(clonesCount.head, { animated: false }) |
339 | 339 | jumped = true |
340 | 340 | } |
341 | 341 | } |
|
357 | 357 | !jumped && applyAutoplayIfNeeded(autoplay) // no need to wait it finishes |
358 | 358 | } |
359 | 359 |
|
360 | | - async function showPage(particleIndex, options) { |
| 360 | + async function showParticle(particleIndex, options) { |
361 | 361 | await changePage( |
362 | 362 | () => store.moveToParticle({ |
363 | 363 | particleIndex, |
|
414 | 414 | } |
415 | 415 | function handleSwipeEnd() { |
416 | 416 | if (!swiping) return |
417 | | - showPage(currentParticleIndex) |
| 417 | + showParticle(currentParticleIndex) |
418 | 418 | } |
419 | 419 | async function handleSwipeFailed() { |
420 | 420 | if (!swiping) return |
|
0 commit comments