Mercurial > gemma
diff client/src/components/fairway/Fairwayprofile.vue @ 3667:c91bcb92e0b7
client: fix rendering of diagram on PDF (Fairwayprofile)
author | Fadi Abbud <fadi.abbud@intevation.de> |
---|---|
date | Mon, 17 Jun 2019 11:00:21 +0200 |
parents | 9e91b416d5bb |
children | c086f5176ef2 |
line wrap: on
line diff
--- a/client/src/components/fairway/Fairwayprofile.vue Sat Jun 15 14:36:50 2019 +0200 +++ b/client/src/components/fairway/Fairwayprofile.vue Mon Jun 17 11:00:21 2019 +0200 @@ -93,7 +93,7 @@ </div> </DiagramLegend> <div - ref="diagramContainer" + id="pdfContainer" class="d-flex flex-fill justify-content-center align-items-center diagram-container position-relative" > <div class="direction-indicator"></div> @@ -464,10 +464,8 @@ addDiagram(position, offset, width, height) { let x = offset.x, y = offset.y; - var svg = this.$refs.diagramContainer.innerHTML; - if (svg) { - svg = svg.replace(/\r?\n|\r/g, "").trim(); - } + let svg = document.querySelector("#pdfContainer>svg").outerHTML; + // use default width,height if they are missing in the template definition if (!width) { width = this.templateData.properties.paperSize === "a3" ? 380 : 290;