Skip to content

Commit

Permalink
tip modal click behavior. closes #252
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshadfield committed Mar 16, 2017
1 parent d7a2ee6 commit 696d646
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/tree/tipSelectedPanel.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*eslint-env browser*/
import React from "react";
import {infoPanelStyles} from "../../globalStyles";

Expand Down Expand Up @@ -34,11 +35,17 @@ const TipSelectedPanel = ({tip, goAwayCallback}) => {
}
};

const stopProp = (e) => {
if (!e) {e = window.event;}
e.cancelBubble = true;
if (e.stopPropagation) {e.stopPropagation();}
};

const makePanel = () => {
if (!tip) {return null;}
return (
<div style={styles.container} onClick={() => goAwayCallback(tip)}>
<div className={"panel"} style={infoPanelStyles.panel}>
<div className={"panel"} style={infoPanelStyles.panel} onClick={(e) => stopProp(e)}>
<p style={infoPanelStyles.modalHeading}>
{`${tip.n.strain}`}
</p>
Expand Down

0 comments on commit 696d646

Please sign in to comment.