changeset 3967:5c896dee852b diagram-cleanup

client: diagram mixin: removed unncessary method params
author Markus Kottlaender <markus@intevation.de>
date Fri, 12 Jul 2019 15:53:20 +0200
parents c10897e0273b
children ea4e1ea04e44
files client/src/lib/mixins.js
diffstat 1 files changed, 6 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- 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;
             }