paged-print.js 388 B

123456789101112
  1. (function (Drupal, once) {
  2. Drupal.behaviors.pagedPrint = {
  3. attach(context) {
  4. once('pagedPrint', 'body', context).forEach(() => {
  5. const params = new URLSearchParams(window.location.search);
  6. if (params.get('print') === '1' && window.PagedPolyfill) {
  7. window.PagedPolyfill.preview();
  8. }
  9. });
  10. }
  11. };
  12. })(Drupal, once);