Merge pull request #118 from sgmap/anti-overlap-fix

🐛 Réparation du problème sur chrome du chevauchement
pull/121/merge
Laurent Bossavit 2017-10-25 14:08:14 +02:00 committed by GitHub
commit 884e1e1120
2 changed files with 7 additions and 8 deletions

View File

@ -21,6 +21,11 @@ import RuleValueVignette from './rule/RuleValueVignette'
})
)
export default class Results extends Component {
componentDidMount(){
setTimeout(() =>
this.props.setElementHeight(this.el.offsetHeight)
, 1)
}
render() {
let {
analysedSituation,
@ -36,7 +41,7 @@ export default class Results extends Component {
let onRulePage = R.contains('/regle/')(location.pathname)
return (
<section id="results" className={classNames({show: showResults})}>
<section ref={el => this.el = el} id="results" className={classNames({show: showResults})}>
{onRulePage && conversationStarted ?
<div id ="results-actions">
<Link id="toSimulation" to={"/simu/" + encodeRuleName(analysedSituation.root.name)}>

View File

@ -28,12 +28,6 @@ export default class Layout extends Component {
state = {
resultsHeight: 600
}
componentDidMount(){
let resultsEl = document.getElementById('results')
this.setState({
resultsHeight: resultsEl ? resultsEl.clientHeight : 600
})
}
render() {
let displayWarning = ["/simu/", "/regle/", "/regles"].find(
t => window.location.href.toString().indexOf(t) > -1
@ -71,7 +65,7 @@ export default class Layout extends Component {
</Switch>
</div>
<div id="antiOverlap" style={{height: this.state.resultsHeight + 'px'}}/>
<Results />
<Results setElementHeight={resultsHeight => this.setState({resultsHeight})}/>
</div>
</Router>
)