Fix diagram mouse event handlers

This commit is contained in:
Thomas Nordquist
2019-06-05 13:22:12 +02:00
parent f8648b92a1
commit b9dcc4a9a8

View File

@@ -40,20 +40,11 @@ const style = (theme: Theme) => {
function ChartIcon(props: { classes: any, literal: JsonPropertyLocation, showDiagram: (dotPath: string, target: EventTarget) => void, hideDiagram: () => void }) {
const mouseOver = (event: React.MouseEvent<Element>) => {
event.stopPropagation()
event.preventDefault()
if ((event.target as Element).tagName !== 'path') {
props.showDiagram(props.literal.path, event.target)
}
props.showDiagram(props.literal.path, event.target)
}
const mouseOut = (event: React.MouseEvent) => {
event.stopPropagation()
event.preventDefault()
if ((event.target as Element).tagName !== 'path') {
props.hideDiagram()
}
props.hideDiagram()
}
return (