+
b.value.priority - a.value.priority);
}
},
+ mounted() {
+ this.checkOverflow();
+ window.addEventListener('resize', this.checkOverflow);
+ },
beforeUnmount() {
this.openmct.indicators.off('addIndicator', this.addIndicator);
+ window.removeEventListener('resize', this.checkOverflow);
},
created() {
this.openmct.indicators.on('addIndicator', this.addIndicator);
@@ -54,6 +60,15 @@ export default {
methods: {
addIndicator(indicator) {
this.indicators.push(shallowRef(indicator));
+ },
+ checkOverflow() {
+ const element = this.$refs.indicators;
+ const sizes = {
+ spaceNeeded: element.scrollWidth,
+ spaceAvail: element.clientWidth
+ };
+ this.indicatorsOverflowing = sizes.spaceNeeded > sizes.spaceAvail;
+ console.log('checkOverflow', this.indicatorsOverflowing, sizes.spaceNeeded, sizes.spaceAvail);
}
}
};