Skip to content

Commit

Permalink
fix(exclude objects): fix tooltip position in object map (#1719)
Browse files Browse the repository at this point in the history
* fix(exclude objects): fix tooltip position in object map

Signed-off-by: Stefan Dej <[email protected]>

* refactor: move style tag at the bottom

Signed-off-by: Stefan Dej <[email protected]>

---------

Signed-off-by: Stefan Dej <[email protected]>
  • Loading branch information
meteyou authored Dec 30, 2023
1 parent 6beca12 commit ff926bf
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/components/panels/Status/ExcludeObjectDialogMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -214,27 +214,28 @@ export default class StatusPanelObjectsDialogMap extends Mixins(BaseMixin) {
}
showObjectTooltip(text: string) {
if (this.$refs.tooltipObjectMap) {
this.$refs.tooltipObjectMap.innerHTML = text
this.$refs.tooltipObjectMap.style.display = 'block'
}
if (!this.$refs.tooltipObjectMap) return
this.$refs.tooltipObjectMap.innerHTML = text
this.$refs.tooltipObjectMap.style.display = 'block'
window.addEventListener('mousemove', this.moveTooltip)
}
hideObjectTooltip() {
if (this.$refs.tooltipObjectMap) {
this.$refs.tooltipObjectMap.style.display = 'none'
}
if (!this.$refs.tooltipObjectMap) return
this.$refs.tooltipObjectMap.style.display = 'none'
window.removeEventListener('mousemove', this.moveTooltip)
}
moveTooltip(event: any) {
if (this.$refs.tooltipObjectMap) {
this.$refs.tooltipObjectMap.style.left = event.layerX - 20 + 'px'
this.$refs.tooltipObjectMap.style.top = event.layerY - 45 + 'px'
}
moveTooltip(event: MouseEvent) {
if (!this.$refs.tooltipObjectMap) return
const top = event.offsetY - this.$refs.tooltipObjectMap.clientHeight - 15
this.$refs.tooltipObjectMap.style.left = `${event.offsetX - 20}px`
this.$refs.tooltipObjectMap.style.top = `${top}px`
}
openExcludeObjectDialog(name: string) {
Expand Down

0 comments on commit ff926bf

Please sign in to comment.