changeset 3881:7db6999962db

mixins: if image given with no explict URL load either configured logo or placeholder
author Thomas Junk <thomas.junk@intevation.de>
date Wed, 10 Jul 2019 09:47:02 +0200
parents 044569f900d1
children 37d5c4441c70
files client/src/lib/mixins.js
diffstat 1 files changed, 8 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/lib/mixins.js	Wed Jul 10 09:08:25 2019 +0200
+++ b/client/src/lib/mixins.js	Wed Jul 10 09:47:02 2019 +0200
@@ -106,7 +106,13 @@
                     url: canvas.toDataURL("image/png")
                   });
                 };
-                image.src = n.url;
+                let URL = n.URL;
+                if (!URL) {
+                  URL = this.logoForPDF
+                    ? this.logoForPDF
+                    : "/img/gemma-logo-for-pdf.png";
+                }
+                image.src = URL;
               })
             );
           }
@@ -303,15 +309,7 @@
         y = this.pdf.height - offset.y - height;
       }
       let image = new Image();
-      if (url) {
-        image.src = url;
-      } else {
-        if (this.logoForPDF) {
-          image.src = this.logoForPDF;
-        } else {
-          image.src = "/img/gemma-logo-for-pdf.png";
-        }
-      }
+      image.src = url;
       if (format === "") {
         let tmp = image.src.split(".");
         format = tmp[tmp.length - 1].toUpperCase();