Do not fail if generatePDF is not defined

This commit is contained in:
Ashwin Madavan 2021-10-11 00:32:30 -07:00 committed by GitHub
parent 66556fe84f
commit d127d5e224
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);