Merge pull request #173 from ashwin153/patch-2

Do not fail if generatePDF is not defined
This commit is contained in:
Somrat 2021-10-13 11:25:55 +06:00 committed by GitHub
commit 974ee76544
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);