From 879233313198d5a9716fd741a13e105b83aa4f16 Mon Sep 17 00:00:00 2001 From: SleepWalker Date: Tue, 2 Feb 2016 20:02:00 +0200 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D1=82=D0=BE=D1=82=D0=B8?= =?UTF-8?q?=D0=BF=20=D0=B0=D0=BD=D0=B8=D0=BC=D0=B0=D1=86=D0=B8=D0=B8=20?= =?UTF-8?q?=D1=81=D0=BC=D0=B5=D0=BD=D1=8B=20=D0=BA=D0=BE=D0=BD=D1=82=D0=B5?= =?UTF-8?q?=D0=BA=D1=81=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/auth/PanelTransition.jsx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/components/auth/PanelTransition.jsx b/src/components/auth/PanelTransition.jsx index 6943c26..4262f5b 100644 --- a/src/components/auth/PanelTransition.jsx +++ b/src/components/auth/PanelTransition.jsx @@ -22,8 +22,14 @@ export default class PanelTransition extends Component { componentWillReceiveProps() { this.setState({ + forceHeight: window.forceHeight, previousRoute: this.props.location }); + + setTimeout(() => { + this.setState({forceHeight: 0}); + window.forceHeight = 0; + }, 100); } render() { @@ -44,7 +50,7 @@ export default class PanelTransition extends Component { opacitySpring: spring(1) }, common: { - heightSpring: spring(height[path] || 0, heightSpringConfig) + heightSpring: spring(this.state.forceHeight || height[path] || 0, heightSpringConfig) } }} willEnter={this.willEnter} @@ -100,7 +106,7 @@ export default class PanelTransition extends Component { '/register': -1, '/password': 1, '/activation': 1, - '/oauth/permissions': 1 + '/oauth/permissions': -1 }; var sign = map[key]; @@ -117,7 +123,7 @@ export default class PanelTransition extends Component { '/register': -1, '/password': 1, '/activation': 1, - '/oauth/permissions': 1 + '/oauth/permissions': -1 }; var sign = map[key]; @@ -201,16 +207,20 @@ export default class PanelTransition extends Component { var direction = map[key]; + var verticalOrigin = 'top'; if (direction === 'Y') { transformSpring = Math.abs(transformSpring); if (prev === key) { transformSpring *= -1; } + + verticalOrigin = 'bottom'; + window.forceHeight = 1; } var style = { position: 'absolute', - top: 0, + [verticalOrigin]: 0, left: 0, width: '100%', WebkitTransform: `translate${direction}(${transformSpring}%)`,