mirror of
https://github.com/nasa/openmct.git
synced 2025-05-31 14:40:48 +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);
|
||||
},
|
||||
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
|
||||
const offsetChange = newOffsetWidth - this.offsetWidth;
|
||||
if (this.$parent.$refs.plotWrapper
|
||||
&& offsetChange > OFFSET_THRESHOLD) {
|
||||
if (offsetChange > OFFSET_THRESHOLD) {
|
||||
this.offsetWidth = newOffsetWidth;
|
||||
this.config.series.models.forEach(this.loadSeriesData, this);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user