Skip to content

Commit f6c8e57

Browse files
Доработка анимации
1 parent 140c540 commit f6c8e57

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

web/client/js/grid.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -696,13 +696,24 @@ window.copyBadgeMarkdown = async function(format) {
696696

697697
// Show copy notification for badge modal
698698
function showBadgeCopyNotification(format) {
699-
const btn = document.querySelector(`.badge-format-section:nth-child(${format === 'svg' ? 2 : 3}) .badge-copy-btn`);
699+
// Find the correct button by format
700+
const sections = document.querySelectorAll('.badge-format-section');
701+
const sectionIndex = format === 'svg' ? 0 : 1;
702+
const btn = sections[sectionIndex]?.querySelector('.badge-copy-btn');
703+
700704
if (btn) {
701-
const originalText = btn.querySelector('.copy-text').textContent;
702-
btn.querySelector('.copy-text').textContent = 'Скопировано!';
705+
const copyIcon = btn.querySelector('.copy-icon');
706+
const copyText = btn.querySelector('.copy-text');
707+
const originalIcon = copyIcon.textContent;
708+
const originalText = copyText.textContent;
709+
710+
copyIcon.textContent = '✓';
711+
copyText.textContent = 'Скопировано!';
703712
btn.classList.add('copied');
713+
704714
setTimeout(() => {
705-
btn.querySelector('.copy-text').textContent = originalText;
715+
copyIcon.textContent = originalIcon;
716+
copyText.textContent = originalText;
706717
btn.classList.remove('copied');
707718
}, 2000);
708719
}

0 commit comments

Comments
 (0)