mirror of
https://github.com/nasa/openmct.git
synced 2025-06-06 09:21:43 +00:00
Check for null plot wrapper on plot resize (#5960)
* check for null plot wrapper first * make code clearer with short circuit up front
This commit is contained in:
parent
a2d8b13204
commit
fabfecdb3e
@ -1192,11 +1192,15 @@ export default {
|
|||||||
this.$emit('statusUpdated', status);
|
this.$emit('statusUpdated', status);
|
||||||
},
|
},
|
||||||
handleWindowResize() {
|
handleWindowResize() {
|
||||||
const newOffsetWidth = this.$parent.$refs.plotWrapper.offsetWidth;
|
const { plotWrapper } = this.$parent.$refs;
|
||||||
|
if (!plotWrapper) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const newOffsetWidth = plotWrapper.offsetWidth;
|
||||||
//we ignore when width gets smaller
|
//we ignore when width gets smaller
|
||||||
const offsetChange = newOffsetWidth - this.offsetWidth;
|
const offsetChange = newOffsetWidth - this.offsetWidth;
|
||||||
if (this.$parent.$refs.plotWrapper
|
if (offsetChange > OFFSET_THRESHOLD) {
|
||||||
&& offsetChange > OFFSET_THRESHOLD) {
|
|
||||||
this.offsetWidth = newOffsetWidth;
|
this.offsetWidth = newOffsetWidth;
|
||||||
this.config.series.models.forEach(this.loadSeriesData, this);
|
this.config.series.models.forEach(this.loadSeriesData, this);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user