Skip to content

Commit

Permalink
PB-412: Fixed resized of elevation profile after pdf print.
Browse files Browse the repository at this point in the history
This avoid to re-draw smaller the profile in the infobox after a pdf print.
  • Loading branch information
ltshb committed Jun 18, 2024
1 parent 1629fe7 commit 090ae09
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/modules/infobox/components/FeatureElevationProfilePlot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,18 @@ export default {
},
},
mounted() {
window.addEventListener('beforeprint', this.resizeChartForPrint)
window.addEventListener('afterprint', this.resizeChart)
// TODO: Here we make sure to do the resize only for the render of the print (currently when animation is disable)
// we should in future use a dedicated variable for this.
if (!this.animation) {
window.addEventListener('beforeprint', this.resizeChartForPrint)
window.addEventListener('afterprint', this.resizeChart)
}
},
unmounted() {
window.removeEventListener('beforeprint', this.resizeChartForPrint)
window.removeEventListener('afterprint', this.resizeChart)
if (!this.animation) {
window.removeEventListener('beforeprint', this.resizeChartForPrint)
window.removeEventListener('afterprint', this.resizeChart)
}
},
methods: {
startPositionTracking() {
Expand Down

0 comments on commit 090ae09

Please sign in to comment.