Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

fix hover issue #2144

Benjamin Kingc8ea7b075842
diff --git a/web/css/vectorMeta.css b/web/css/vectorMeta.css
index 89335c1e4..13fe653d4 100644
--- a/web/css/vectorMeta.css
+++ b/web/css/vectorMeta.css
@@ -44,6 +44,11 @@
.vector-info-tooltip-case {
position: relative;
}
+.vector-info-tooltip-case .sub-case {
+ position: absolute;
+ width: 15px;
+ height: 10px;
+}
.vector-modal .vector-info-icon {
position: absolute;
font-size: 8px;
diff --git a/web/js/components/vector-metadata/tooltip.js b/web/js/components/vector-metadata/tooltip.js
index 1fa01a1e8..fed057c27 100644
--- a/web/js/components/vector-metadata/tooltip.js
+++ b/web/js/components/vector-metadata/tooltip.js
@@ -8,6 +8,8 @@ export default class VectorMetaTooltip extends React.Component {
super(props);
this.toggle = this.toggle.bind(this);
+ this.mouseEnter = this.mouseEnter.bind(this);
+ this.mouseLeave = this.mouseLeave.bind(this);
this.state = {
tooltipOpen: false
};
@@ -18,21 +20,29 @@ export default class VectorMetaTooltip extends React.Component {
tooltipOpen: !this.state.tooltipOpen
});
}
-
+ mouseEnter() {
+ this.setState({
+ tooltipOpen: true
+ });
+ }
+ mouseLeave() {
+ this.setState({
+ tooltipOpen: false
+ });
+ }
render() {
const { id, index, description } = this.props;
const elId = util.cleanId(String('tooltip' + id + index));
return (
- <div className='vector-info-tooltip-case' key={elId}>
- <span href="#" id={elId}><i className="fa fa-info vector-info-icon"></i></span>
+ <div className='vector-info-tooltip-case' onMouseEnter={this.mouseEnter} onMouseLeave={this.mouseLeave} key={elId}>
+ <div id={elId} className='sub-case' ><i className="fa fa-info vector-info-icon cursor-pointer"></i></div>
<Tooltip
dangerouslySetInnerHTML={{ __html: description }}
boundariesElement="window"
- placement="top"
+ placement="right"
isOpen={this.state.tooltipOpen}
target={elId}
- toggle={this.toggle}
fade={false}
>
</Tooltip>