Skip to content

Commit

Permalink
add tooltip class and only offset swimlane
Browse files Browse the repository at this point in the history
  • Loading branch information
scottbell committed Dec 16, 2024
1 parent 20247bb commit 20426fe
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/api/tooltips/ToolTip.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ import TooltipComponent from './components/TooltipComponent.vue';

class Tooltip extends EventEmitter {
constructor(
{ toolTipText, toolTipLocation, parentElement } = {
{ toolTipText, toolTipLocation, parentElement, cssClasses } = {
tooltipText: '',
toolTipLocation: 'below',
parentElement: null
parentElement: null,
cssClasses: []
}
) {
super();
Expand All @@ -42,7 +43,8 @@ class Tooltip extends EventEmitter {
provide: {
toolTipText,
toolTipLocation,
parentElement
parentElement,
cssClasses
},
template: '<tooltip-component toolTipText="toolTipText"></tooltip-component>'
});
Expand Down
2 changes: 1 addition & 1 deletion src/api/tooltips/ToolTipAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class TooltipAPI {
*/

/**
* Tooltips take an options object that consists of the string, tooltipLocation, and parentElement
* Tooltips take an options object that consists of the string, tooltipLocation, a parentElement, and an array of cssClasses
* @param {TooltipOptions} options
*/
tooltip(options) {
Expand Down
3 changes: 2 additions & 1 deletion src/api/tooltips/components/TooltipComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ at runtime from the About dialog for additional information.
<div
ref="tooltip-wrapper"
class="c-menu c-tooltip-wrapper"
:class="cssClasses"
:style="toolTipLocationStyle"
role="tooltip"
aria-labelledby="tooltip-text"
Expand All @@ -36,7 +37,7 @@ at runtime from the About dialog for additional information.

<script>
export default {
inject: ['toolTipText', 'toolTipLocation', 'parentElement'],
inject: ['toolTipText', 'toolTipLocation', 'parentElement', 'cssClasses'],
computed: {
toolTipCoordinates() {
return this.parentElement.getBoundingClientRect();
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/events/components/EventTimelineView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,8 @@ export default {
this.tooltip = this.openmct.tooltips.tooltip({
toolTipText: textToShow,
toolTipLocation: this.openmct.tooltips.TOOLTIP_LOCATIONS.RIGHT,
parentElement: referenceElement
parentElement: referenceElement,
cssClasses: ['c-timeline-event-tooltip']
});
},
checkIfOurEvent(keyString) {
Expand Down

0 comments on commit 20426fe

Please sign in to comment.