# HG changeset patch # User Bernhard Reiter # Date 1538388106 -7200 # Node ID 52fe3e20f750f32c0d31813faeff77347940990c # Parent 42df1cabf410d3d993d1b7c224865712510289e0 client: improve print styling * Set explicit pixel width and height for the map for printing. This results in a map which roughly has the right scale, though it is not centered on the screen view anymore and also does not take up the full printed page. * Add handlers for detecting print events, with some experiments in deactivated code. diff -r 42df1cabf410 -r 52fe3e20f750 client/src/application/Main.vue --- a/client/src/application/Main.vue Sat Sep 29 22:35:53 2018 +0200 +++ b/client/src/application/Main.vue Mon Oct 01 12:01:46 2018 +0200 @@ -81,6 +81,7 @@ }, created() { window.addEventListener("resize", debounce(this.scaleFairwayProfile), 100); + window.addEventListener("onbeforeprint", this.test); }, updated() { this.scaleFairwayProfile(); @@ -89,6 +90,9 @@ window.removeEventListener("resize", debounce(this.scaleFairwayProfile)); }, methods: { + test(evt) { + console.log("test: ", evt); + }, scaleFairwayProfile() { if (!document.querySelector(".profile")) return; const clientHeight = document.querySelector(".profile").clientHeight; diff -r 42df1cabf410 -r 52fe3e20f750 client/src/map/Maplayer.vue --- a/client/src/map/Maplayer.vue Sat Sep 29 22:35:53 2018 +0200 +++ b/client/src/map/Maplayer.vue Mon Oct 01 12:01:46 2018 +0200 @@ -10,6 +10,17 @@ .mapfull { height: 100vh; } + +@media print { + .mapfull { + width: 2000px; + heigth: 2828px; + } + .mapsplit { + width: 2000px; + heigth: 2828px; + } +}