Skip to content

Commit 8c31c98

Browse files
authored
Merge pull request #63 from ProLoser/copilot/fix-duplicate-details-rendering
Fix duplicate content in floating event card after swipe navigation
2 parents 23c2db0 + 1674c82 commit 8c31c98

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

map.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,11 @@ function buildCardContent(container, event) {
101101
function showEventCard(event) {
102102
currentCardIndex = visibleEventsList.indexOf(event);
103103
const current = document.getElementById('event-card-current');
104+
const peek = document.getElementById('event-card-peek');
104105
current.style.transition = 'none';
105106
current.style.transform = 'translateX(0)';
107+
peek.style.transition = 'none';
108+
peek.style.transform = 'translateX(100%)';
106109
buildCardContent(current, event);
107110
document.getElementById('event-card-counter').textContent =
108111
`${currentCardIndex + 1} of ${visibleEventsList.length}`;
@@ -146,7 +149,7 @@ function finishNavigation(current, peek, newIndex) {
146149
current.style.transition = 'none';
147150
peek.style.transition = 'none';
148151
current.style.transform = 'translateX(0)';
149-
peek.style.transform = '';
152+
peek.style.transform = 'translateX(100%)';
150153
buildCardContent(current, visibleEventsList[currentCardIndex]);
151154
document.getElementById('event-card-counter').textContent =
152155
`${currentCardIndex + 1} of ${visibleEventsList.length}`;

0 commit comments

Comments
 (0)