use this.el instead of hardcoded layout ref

This commit is contained in:
Scott Bell 2025-03-07 11:17:52 +01:00
parent af6f3274cb
commit bbae9c6048

View File

@ -196,16 +196,15 @@ export default {
}
},
getClientWidth() {
let clientWidth = this.$refs.events.clientWidth;
// Try to use the components own element first
let clientWidth = this.$refs.events?.clientWidth;
if (!clientWidth) {
//this is a hack - need a better way to find the parent of this component
const parent = this.openmct.layout.$refs.browseObject.$el;
// Fallback: use the actual container element (the immediate parent)
const parent = this.$el.parentElement;
if (parent) {
clientWidth = parent.getBoundingClientRect().width;
}
}
return clientWidth;
},
updateViewBounds(bounds, isTick) {