comparison client/src/lib/mixins.js @ 3350:8da2f7b9a04b

client: diagram-template:remove unnecessary template properties and typo
author Fadi Abbud <fadi.abbud@intevation.de>
date Tue, 21 May 2019 12:34:49 +0200
parents 107de6def0c3
children 169680c3698b
comparison
equal deleted inserted replaced
3349:ac0006f675c0 3350:8da2f7b9a04b
8 * – Österreichische Wasserstraßen-Gesellschaft mbH 8 * – Österreichische Wasserstraßen-Gesellschaft mbH
9 * Software engineering by Intevation GmbH 9 * Software engineering by Intevation GmbH
10 * 10 *
11 * Author(s): 11 * Author(s):
12 * Markus Kottländer <markus.kottlaender@intevation.de> 12 * Markus Kottländer <markus.kottlaender@intevation.de>
13 * * Fadi Abbud <fadi.abbud@intevation.de> 13 * Fadi Abbud <fadi.abbud@intevation.de>
14 */ 14 */
15 import locale2 from "locale2"; 15 import locale2 from "locale2";
16 export const sortTable = { 16 export const sortTable = {
17 data() { 17 data() {
18 return { 18 return {
86 }, 86 },
87 replacePlaceholders(text) { 87 replacePlaceholders(text) {
88 if (text.includes("{date}")) { 88 if (text.includes("{date}")) {
89 text = text.replace("{date}", new Date().toLocaleString(locale2)); 89 text = text.replace("{date}", new Date().toLocaleString(locale2));
90 } 90 }
91 //get only day,month and year from the Date object 91 // get only day,month and year from the Date object
92 if (text.includes("{date-minor}")) { 92 if (text.includes("{date-minor}")) {
93 var date = new Date(); 93 var date = new Date();
94 var dt = 94 var dt =
95 (date.getDate() < 10 ? "0" : "") + 95 (date.getDate() < 10 ? "0" : "") +
96 date.getDate() + 96 date.getDate() +
139 x = this.pdf.width - offset.x - width; 139 x = this.pdf.width - offset.x - width;
140 } 140 }
141 if (["bottomright", "bottomleft"].indexOf(position) !== -1) { 141 if (["bottomright", "bottomleft"].indexOf(position) !== -1) {
142 y = this.pdf.height - offset.y - height; 142 y = this.pdf.height - offset.y - height;
143 } 143 }
144
145 this.addRoundedBox(x, y, width, height, color, rounding, brcolor); 144 this.addRoundedBox(x, y, width, height, color, rounding, brcolor);
146 }, 145 },
147 getTextHeight(numberOfLines) { 146 getTextHeight(numberOfLines) {
148 return ( 147 return (
149 numberOfLines * 148 numberOfLines *
197 let textWidth = width - 2 * padding; 196 let textWidth = width - 2 * padding;
198 if (!height) { 197 if (!height) {
199 let textLines = this.pdf.doc.splitTextToSize(text, textWidth); 198 let textLines = this.pdf.doc.splitTextToSize(text, textWidth);
200 height = this.getTextHeight(textLines.length) + 2 * padding; 199 height = this.getTextHeight(textLines.length) + 2 * padding;
201 } 200 }
202
203 this.addBox( 201 this.addBox(
204 position, 202 position,
205 offset, 203 offset,
206 width, 204 width,
207 height, 205 height,