# HG changeset patch # User Markus Kottlaender # Date 1562939600 -7200 # Node ID 5c896dee852bdd899f0e3770f14cf6e4fa8dbc37 # Parent c10897e0273b8509d0e81e601b4ee9826da9f24a client: diagram mixin: removed unncessary method params diff -r c10897e0273b -r 5c896dee852b client/src/lib/mixins.js --- a/client/src/lib/mixins.js Fri Jul 12 15:36:02 2019 +0200 +++ b/client/src/lib/mixins.js Fri Jul 12 15:53:20 2019 +0200 @@ -186,10 +186,7 @@ }, methods: { downloadPDF() { - this.generatePDF({ - templateData: this.templateData, - diagramTitle: this.title - }); + this.generatePDF(); this.pdf.doc.save( this.title.replace(/\s/g, "_").replace(/[():,]/g, "") + ".pdf" @@ -260,12 +257,12 @@ ")" ); }, - generatePDF(params) { + generatePDF() { // creates a new jsPDF object into this.pdf.doc // will call functions that the calling context has to provide // as specified in the templateData - let templateData = params["templateData"]; - let diagramTitle = params["diagramTitle"]; + const templateData = this.templateData; + const diagramTitle = this.title; this.pdf.doc = new jsPDF("l", "mm", templateData.properties.paperSize); // pdf width and height in millimeter (landscape) @@ -296,9 +293,9 @@ e.offset || defaultOffset, // use default width,height if they are missing in template definition e.width || - (this.templateData.properties.paperSize === "a3" ? 318 : 230), + (templateData.properties.paperSize === "a3" ? 318 : 230), e.height || - (this.templateData.properties.paperSize === "a3" ? 104 : 110) + (templateData.properties.paperSize === "a3" ? 104 : 110) ); break; }