improved click precision

This commit is contained in:
dzannotti 2015-08-10 23:23:32 +01:00
parent 1394ea0493
commit 7ad9616777
3 changed files with 11 additions and 9 deletions

View File

@ -6,6 +6,7 @@ import grabNode from './grab-node';
const styles = { const styles = {
base: { base: {
position: 'relative',
paddingTop: 2, paddingTop: 2,
paddingBottom: 2, paddingBottom: 2,
paddingRight: 4, paddingRight: 4,
@ -100,15 +101,15 @@ export default class JSONArrayNode extends React.Component {
}; };
} }
return ( return (
<li style={containerStyle} onClick={::this.handleClick}> <li style={containerStyle}>
<JSONArrow theme={this.props.theme} open={this.state.expanded}/> <JSONArrow theme={this.props.theme} open={this.state.expanded} onClick={::this.handleClick}/>
<label style={{ <label style={{
...styles.label, ...styles.label,
color: this.props.theme.base0D color: this.props.theme.base0D
}}> }} onClick={::this.handleClick}>
{this.props.keyName}: {this.props.keyName}:
</label> </label>
<span style={spanStyle}> <span style={spanStyle} onClick={::this.handleClick}>
<span style={styles.spanType}>[]</span> <span style={styles.spanType}>[]</span>
{this.getItemString()} {this.getItemString()}
</span> </span>

View File

@ -36,6 +36,6 @@ export default class JSONArrow extends React.Component {
...styles.open ...styles.open
}; };
} }
return <div style={style}/>; return <div style={style} onClick={this.props.onClick}/>;
} }
} }

View File

@ -6,6 +6,7 @@ import grabNode from './grab-node';
const styles = { const styles = {
base: { base: {
position: 'relative',
paddingTop: 2, paddingTop: 2,
paddingBottom: 2, paddingBottom: 2,
paddingRight: 4, paddingRight: 4,
@ -102,15 +103,15 @@ export default class JSONObjectNode extends React.Component {
}; };
} }
return ( return (
<li style={containerStyle} onClick={::this.handleClick}> <li style={containerStyle}>
<JSONArrow theme={this.props.theme} open={this.state.expanded}/> <JSONArrow theme={this.props.theme} open={this.state.expanded} onClick={::this.handleClick}/>
<label style={{ <label style={{
...styles.label, ...styles.label,
color: this.props.theme.base0D color: this.props.theme.base0D
}}> }} onClick={::this.handleClick}>
{this.props.keyName}: {this.props.keyName}:
</label> </label>
<span style={spanStyle}> <span style={spanStyle} onClick={::this.handleClick}>
<span style={styles.spanType}>&#123;&#125;</span> <span style={styles.spanType}>&#123;&#125;</span>
{this.getItemString()} {this.getItemString()}
</span> </span>