Browse
For agents
About
Blockenberg — 600+ Advanced Gutenberg Blocks & AI Agent for WordPress Block Editor
/
2.0.13
Blockenberg — 600+ Advanced Gutenberg Blocks & AI Agent for WordPress Block Editor
v2.0.13
Switch version
2.0.13
2.0.12
2.0.11
2.0.10
2.0.9
trunk
2.0.2
2.0.3
2.0.4
2.0.5
2.0.6
2.0.7
2.0.8
Overview
Code
blockenberg
/
blocks
/
print-button
/
frontend.js
frontend.js
in Blockenberg — 600+ Advanced Gutenberg Blocks & AI Agent for WordPress Block Editor 2.0.13, at blocks/print-button/frontend.js
24 lines
431 B
Find file
t
No matching file
Up and down to move
Enter to open
Esc to close
Raw
Download
Zip
View raw
1
/*
Print / PDF Button — frontend
*/
2
(
function
(
)
{
3
'
use strict
'
;
4
5
function
onClick
(
e
)
{
6
var
btn
=
e
.
target
.
closest
(
'
[data-bkbg-print="1"]
'
)
;
7
if
(
!
btn
)
{
8
return
;
9
}
10
e
.
preventDefault
(
)
;
11
window
.
print
(
)
;
12
}
13
14
function
init
(
)
{
15
document
.
addEventListener
(
'
click
'
,
onClick
)
;
16
}
17
18
if
(
document
.
readyState
===
'
loading
'
)
{
19
document
.
addEventListener
(
'
DOMContentLoaded
'
,
init
)
;
20
}
else
{
21
init
(
)
;
22
}
23
}
(
)
)
;
24