Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

all-articles.ts 630 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  1. /**
  2. * Handles the client-side events for `includes/all-articles.html`.
  3. */
  4. export default function allArticles() {
  5. const buttons = document.querySelectorAll('button.js-all-articles-show-more')
  6. buttons.forEach((btn) =>
  7. btn.addEventListener('click', (evt) => {
  8. const target = evt.currentTarget as HTMLButtonElement
  9. // Show all hidden links
  10. const hiddenLinks = target?.parentElement?.querySelectorAll('li.d-none')
  11. hiddenLinks?.forEach((link) => link.classList.remove('d-none'))
  12. // Remove the button, since we don't need it anymore
  13. target?.parentElement?.removeChild(target)
  14. })
  15. )
  16. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...