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