Skip to content

Commit

Permalink
Scroll to top when clicking on a timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue committed Feb 20, 2024
1 parent 8445273 commit 822544f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default defineComponent({
}).href

// Adding the URL lets the user open the video in a new window at this timestamp
return `<a href="${url}" onclick="event.preventDefault();this.dispatchEvent(new CustomEvent('timestamp-clicked',{bubbles:true,detail:${time}}))">${timestamp}</a>`
return `<a href="${url}" onclick="event.preventDefault();this.dispatchEvent(new CustomEvent('timestamp-clicked',{bubbles:true,detail:${time}}));window.scrollTo(0,0)">${timestamp}</a>`
})
}
}
Expand Down

0 comments on commit 822544f

Please sign in to comment.