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.js 620 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
18
  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. for (const btn of buttons) {
  7. btn.addEventListener('click', evt => {
  8. // Show all hidden links
  9. const hiddenLinks = evt.currentTarget.parentElement.querySelectorAll('li.d-none')
  10. for (const link of hiddenLinks) {
  11. link.classList.remove('d-none')
  12. }
  13. // Remove the button, since we don't need it anymore
  14. evt.currentTarget.parentElement.removeChild(evt.currentTarget)
  15. })
  16. }
  17. }
Tip!

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

Comments

Loading...