mirror of
https://github.com/nasa/openmct.git
synced 2024-12-24 23:36:41 +00:00
add tooltip
This commit is contained in:
parent
cda7cc9d06
commit
d048af108e
@ -64,7 +64,8 @@ export default {
|
|||||||
eventHistory: [],
|
eventHistory: [],
|
||||||
timeSystem: timeSystem,
|
timeSystem: timeSystem,
|
||||||
extendLines: false,
|
extendLines: false,
|
||||||
titleKey: null
|
titleKey: null,
|
||||||
|
tooltip: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -420,7 +421,13 @@ export default {
|
|||||||
eventTickElement.style.width = '2px';
|
eventTickElement.style.width = '2px';
|
||||||
eventTickElement.style.height = `${String(ROW_HEIGHT - 10)}px`;
|
eventTickElement.style.height = `${String(ROW_HEIGHT - 10)}px`;
|
||||||
if (this.titleKey) {
|
if (this.titleKey) {
|
||||||
eventTickElement.title = event[this.titleKey];
|
const textToShow = event[this.titleKey];
|
||||||
|
eventWrapper.addEventListener('mouseover', () => {
|
||||||
|
this.showToolTip(textToShow, eventTickElement);
|
||||||
|
});
|
||||||
|
eventWrapper.addEventListener('mouseleave', () => {
|
||||||
|
this.tooltip?.destroy();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
eventWrapper.appendChild(eventTickElement);
|
eventWrapper.appendChild(eventTickElement);
|
||||||
const limitEvaluation = this.limitEvaluator.evaluate(event, this.valueMetadata);
|
const limitEvaluation = this.limitEvaluator.evaluate(event, this.valueMetadata);
|
||||||
@ -452,6 +459,13 @@ export default {
|
|||||||
keyString: this.keyString
|
keyString: this.keyString
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
showToolTip(textToShow, referenceElement) {
|
||||||
|
this.tooltip = this.openmct.tooltips.tooltip({
|
||||||
|
toolTipText: textToShow,
|
||||||
|
toolTipLocation: this.openmct.tooltips.TOOLTIP_LOCATIONS.RIGHT,
|
||||||
|
parentElement: referenceElement
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user