Skip to content

Commit

Permalink
Fix asciinema-player (#1597)
Browse files Browse the repository at this point in the history
Click title for asciinema-player doesn't run player, because logic is
described outside the scope of the variable "player".
  • Loading branch information
SvMak authored Dec 1, 2024
1 parent ed6b212 commit 916f453
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/components/ui/Asciinema.astro
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ const demoId = 'asciinema-demo-' + src.split('/').pop().split('.')[0];

document.fonts.load('1em ' + settings.terminalFontFamily).then(() => {
const player = AsciinemaPlayer.create(src, this, settings);
});

if (this.dataset.title) {
document
.getElementById(`${this.id}-link`)
.addEventListener('click', (e) => {
player.play();
});
}
if (this.dataset.title) {
document
.getElementById(`${this.id}-link`)
.addEventListener('click', (e) => {
player.play();
});
}
});
}
}

Expand Down

0 comments on commit 916f453

Please sign in to comment.