Rename vars
This commit is contained in:
@@ -127,16 +127,16 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
let currentPageIndex = 0
|
let currentPageIndex = 0
|
||||||
$: originalCurrentPageIndex = getCurrentPageIndexWithoutClones({
|
$: currentPageIndexWithoutClones = getCurrentPageIndexWithoutClones({
|
||||||
currentPageIndex,
|
currentPageIndex,
|
||||||
pagesCount,
|
pagesCount,
|
||||||
oneSideClonesCount,
|
oneSideClonesCount,
|
||||||
infinite,
|
infinite,
|
||||||
})
|
})
|
||||||
$: dispatch('pageChange', originalCurrentPageIndex)
|
$: dispatch('pageChange', currentPageIndexWithoutClones)
|
||||||
|
|
||||||
let pagesCount = 0
|
let pagesCount = 0
|
||||||
$: originalPagesCount = getPagesCountWithoutClones({
|
$: pagesCountWithoutClones = getPagesCountWithoutClones({
|
||||||
pagesCount,
|
pagesCount,
|
||||||
oneSideClonesCount,
|
oneSideClonesCount,
|
||||||
})
|
})
|
||||||
@@ -168,8 +168,8 @@
|
|||||||
|
|
||||||
// used for lazy loading images, preloaded only current, adjacent and cloanable images
|
// used for lazy loading images, preloaded only current, adjacent and cloanable images
|
||||||
$: loaded = getAdjacentIndexes({
|
$: loaded = getAdjacentIndexes({
|
||||||
pageIndex: originalCurrentPageIndex,
|
pageIndex: currentPageIndexWithoutClones,
|
||||||
pagesCount: originalPagesCount,
|
pagesCount: pagesCountWithoutClones,
|
||||||
infinite,
|
infinite,
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -364,7 +364,7 @@
|
|||||||
<div class="sc-carousel__arrow-container">
|
<div class="sc-carousel__arrow-container">
|
||||||
<Arrow
|
<Arrow
|
||||||
direction="prev"
|
direction="prev"
|
||||||
disabled={!infinite && originalCurrentPageIndex === 0}
|
disabled={!infinite && currentPageIndexWithoutClones === 0}
|
||||||
on:click={showPrevPage}
|
on:click={showPrevPage}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -408,7 +408,7 @@
|
|||||||
<div class="sc-carousel__arrow-container">
|
<div class="sc-carousel__arrow-container">
|
||||||
<Arrow
|
<Arrow
|
||||||
direction="next"
|
direction="next"
|
||||||
disabled={!infinite && originalCurrentPageIndex === originalPagesCount - 1}
|
disabled={!infinite && currentPageIndexWithoutClones === pagesCountWithoutClones - 1}
|
||||||
on:click={showNextPage}
|
on:click={showNextPage}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -418,13 +418,13 @@
|
|||||||
{#if dots}
|
{#if dots}
|
||||||
<slot
|
<slot
|
||||||
name="dots"
|
name="dots"
|
||||||
currentPageIndex={originalCurrentPageIndex}
|
currentPageIndex={currentPageIndexWithoutClones}
|
||||||
pagesCount={originalPagesCount}
|
pagesCount={pagesCountWithoutClones}
|
||||||
showPage={handlePageChange}
|
showPage={handlePageChange}
|
||||||
>
|
>
|
||||||
<Dots
|
<Dots
|
||||||
pagesCount={originalPagesCount}
|
pagesCount={pagesCountWithoutClones}
|
||||||
currentPageIndex={originalCurrentPageIndex}
|
currentPageIndex={currentPageIndexWithoutClones}
|
||||||
on:pageChange={event => handlePageChange(event.detail)}
|
on:pageChange={event => handlePageChange(event.detail)}
|
||||||
></Dots>
|
></Dots>
|
||||||
</slot>
|
</slot>
|
||||||
|
|||||||
Reference in New Issue
Block a user