Show hint when hovering over function icon

This commit is contained in:
Lukas Martinelli 2017-01-09 22:54:30 +01:00
parent d3276829b2
commit cff0a15f7e
2 changed files with 9 additions and 1 deletions

View file

@ -8,6 +8,7 @@ export default class DocLabel extends React.Component {
label: React.PropTypes.string.isRequired, label: React.PropTypes.string.isRequired,
doc: React.PropTypes.string.isRequired, doc: React.PropTypes.string.isRequired,
style: React.PropTypes.object, style: React.PropTypes.object,
cursorTargetStyle: React.PropTypes.object,
} }
constructor(props) { constructor(props) {
@ -29,6 +30,7 @@ export default class DocLabel extends React.Component {
onMouseOut={e => this.setState({showDoc: false})} onMouseOut={e => this.setState({showDoc: false})}
style={{ style={{
cursor: 'help', cursor: 'help',
...this.props.cursorTargetStyle,
}} }}
> >
{this.props.label} {this.props.label}

View file

@ -174,10 +174,16 @@ export default class ZoomSpecField extends React.Component {
verticalAlign: 'top', verticalAlign: 'top',
backgroundColor: null, backgroundColor: null,
display: 'inline-block', display: 'inline-block',
paddingBottom: 0,
paddingTop: 0,
}} }}
onClick={this.makeZoomFunction.bind(this)} onClick={this.makeZoomFunction.bind(this)}
> >
<FunctionIcon /> <DocLabel
label={<FunctionIcon />}
cursorTargetStyle={{ cursor: 'pointer' }}
doc="Turn property into a zoom function to enable a map feature to change with map's zoom level."
/>
</Button> </Button>
} }
<SpecField {...this.props} style={{ width: '50%' } }/> <SpecField {...this.props} style={{ width: '50%' } }/>