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

print.ts 429 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. import { EventType, sendEvent } from './events'
  2. export default function () {
  3. const printButtons = document.querySelectorAll('.js-print')
  4. Array.from(printButtons).forEach((btn) => {
  5. // Open the print dialog when the button is clicked
  6. btn.addEventListener('click', () => {
  7. window.print()
  8. })
  9. })
  10. // Track print events
  11. window.onbeforeprint = function () {
  12. sendEvent({ type: EventType.print })
  13. }
  14. }
Tip!

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

Comments

Loading...