comparison client/src/components/gauge/HydrologicalConditions.vue @ 3894:e5bd8601bee1

Client: remove unnecessary condition and comments (waterlevels,hydrologicalconditions)
author Fadi Abbud <fadi.abbud@intevation.de>
date Wed, 10 Jul 2019 15:26:45 +0200
parents 83c4672369a2
children 0149b68a4f7e
comparison
equal deleted inserted replaced
3893:9dfd225b92e8 3894:e5bd8601bee1
243 addDiagram(position, offset, width, height) { 243 addDiagram(position, offset, width, height) {
244 let x = offset.x, 244 let x = offset.x,
245 y = offset.y; 245 y = offset.y;
246 const svgWidth = this.millimeter2pixels(width, 80); 246 const svgWidth = this.millimeter2pixels(width, 80);
247 const svgHeight = this.millimeter2pixels(height, 80); 247 const svgHeight = this.millimeter2pixels(height, 80);
248 // check if there are tow diagrams on the screen
249 // draw the diagram in a separated html element to get the full size 248 // draw the diagram in a separated html element to get the full size
250 const offScreen = document.querySelector("#offScreen"); 249 const offScreen = document.querySelector("#offScreen");
251 offScreen.style.width = `${svgWidth}px`; 250 offScreen.style.width = `${svgWidth}px`;
252 offScreen.style.height = `${svgHeight}px`; 251 offScreen.style.height = `${svgHeight}px`;
253 this.renderTo({ 252 this.renderTo({
256 svgWidth: svgWidth, 255 svgWidth: svgWidth,
257 svgHeight: svgHeight 256 svgHeight: svgHeight
258 }) 257 })
259 }); 258 });
260 var svg = offScreen.querySelector("svg"); 259 var svg = offScreen.querySelector("svg");
261 // use default width,height if they are missing in the template definition
262 if (!width) {
263 width = this.templateData.properties.paperSize === "a3" ? 380 : 290;
264 }
265 if (!height) {
266 height = this.templateData.properties.paperSize === "a3" ? 130 : 100;
267 }
268 if (["topright", "bottomright"].indexOf(position) !== -1) { 260 if (["topright", "bottomright"].indexOf(position) !== -1) {
269 x = this.pdf.width - offset.x - width; 261 x = this.pdf.width - offset.x - width;
270 } 262 }
271 if (["bottomright", "bottomleft"].indexOf(position) !== -1) { 263 if (["bottomright", "bottomleft"].indexOf(position) !== -1) {
272 y = this.pdf.height - offset.y - height; 264 y = this.pdf.height - offset.y - height;