diff options
| author | Adam Soltys <[email protected]> | 2026-10-14 23:29:40 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-10-14 23:29:40 -0700 |
| commit | c5d42cd305f2f96e84a7526fef1cffcc6aeaac02 (patch) | |
| tree | 697cff4caa9b1d258f979f0ccb59c23b954e91a1 /src/features | |
| parent | 686309a584a8e7a13091cb194e42aa09e2aec5d5 (diff) | |
| download | coinosv3-c5d42cd305f2f96e84a7526fef1cffcc6aeaac02.tar.gz coinosv3-c5d42cd305f2f96e84a7526fef1cffcc6aeaac02.zip | |
Count posts rather than images in media pager
Diffstat (limited to 'src/features')
| -rw-r--r-- | src/features/messages.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/features/messages.js b/src/features/messages.js index ccba6ad..c568ae0 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -12588,9 +12588,10 @@ export function messagesFeature(ctx) { } function pagerPosition() { if (!pager) return; - const slides = pagerSlides(); - const index = slides.indexOf(pager.cur || pager.anchor); - pager.el.querySelector('.mp-position').textContent = (index < 0 ? 0 : index + 1) + ' / ' + slides.length; + const groups = pagerGroups(); + const slide = pager.cur || pager.anchor; + const index = groups.indexOf(slide && slide.closest('.mp-group')); + pager.el.querySelector('.mp-position').textContent = (index < 0 ? 0 : index + 1) + ' / ' + groups.length; } function buildPager(want) { |
