forked from TrueCloudLab/dot-hugo
Do not fail if generatePDF is not defined
This commit is contained in:
parent
66556fe84f
commit
d127d5e224
1 changed files with 4 additions and 3 deletions
|
@ -130,8 +130,9 @@
|
||||||
|
|
||||||
// Download page to pdf format
|
// Download page to pdf format
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
document.getElementById("generatePDF")
|
var generatePDF = document.getElementById('generatePDF');
|
||||||
.addEventListener("click", () => {
|
if (typeof(generatePDF) != 'undefined' && generatePDF != null) {
|
||||||
|
generatePDF.addEventListener("click", () => {
|
||||||
const content = this.document.getElementById("content");
|
const content = this.document.getElementById("content");
|
||||||
console.log(content);
|
console.log(content);
|
||||||
console.log(window);
|
console.log(window);
|
||||||
|
|
Loading…
Reference in a new issue