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
|
||||
window.onload = function() {
|
||||
document.getElementById("generatePDF")
|
||||
.addEventListener("click", () => {
|
||||
var generatePDF = document.getElementById('generatePDF');
|
||||
if (typeof(generatePDF) != 'undefined' && generatePDF != null) {
|
||||
generatePDF.addEventListener("click", () => {
|
||||
const content = this.document.getElementById("content");
|
||||
console.log(content);
|
||||
console.log(window);
|
||||
|
@ -146,4 +147,4 @@
|
|||
})
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
})(jQuery);
|
||||
|
|
Loading…
Reference in a new issue