Prepend 0 to index if under 10 on Photo Viewer
This commit is contained in:
@@ -33,6 +33,7 @@
|
|||||||
$: canGoNext = !isLoading && (hasPrev || currentIndex !== 0)
|
$: canGoNext = !isLoading && (hasPrev || currentIndex !== 0)
|
||||||
// Define current photo
|
// Define current photo
|
||||||
$: currentPhoto = photos[currentIndex]
|
$: currentPhoto = photos[currentIndex]
|
||||||
|
$: currentPhotoIndex = globalOffset + currentIndex + 1
|
||||||
|
|
||||||
// Take 7 photos in the global photos array (5 for current, 1 before first and 1 after last)
|
// Take 7 photos in the global photos array (5 for current, 1 before first and 1 after last)
|
||||||
// Start one index before the current image since the first one will be invisible
|
// Start one index before the current image since the first one will be invisible
|
||||||
@@ -191,7 +192,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span class="viewer-photo__index title-index">
|
<span class="viewer-photo__index title-index">
|
||||||
{globalOffset + currentIndex + 1}
|
{(currentPhotoIndex < 10) ? '0' : ''}{currentPhotoIndex}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user