mirror of
https://github.com/nasa/openmct.git
synced 2025-03-13 07:54:13 +00:00
use this.el instead of hardcoded layout ref
This commit is contained in:
parent
af6f3274cb
commit
bbae9c6048
@ -196,16 +196,15 @@ export default {
|
||||
}
|
||||
},
|
||||
getClientWidth() {
|
||||
let clientWidth = this.$refs.events.clientWidth;
|
||||
|
||||
// Try to use the component’s 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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user