Created
March 23, 2015 13:44
-
-
Save valer-cara/a1136cc066a2118e38c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
componentDidUpdate: function(prevProps, prevState) { | |
var _this = this, shouldTransition, shouldStartAnimation; | |
shouldStartAnimation = this.state.transitionStarted && !this.state.isTransitioning; | |
if (shouldStartAnimation) { | |
this.setState({ isTransitioning: true }); | |
} | |
shouldTransition = !this.state.transitionStarted && | |
!this._equalScreens(this.state.activeScreen, this.state.screensStackTop); | |
if (shouldTransition) { | |
this.setState({ | |
transitionStarted: true, | |
transitionDirection: this.state.activeScreen.get('stackIndex') > this.state.screensStackTop.get('stackIndex') ? "back" : "fwd" | |
}); | |
setTimeout(function() { | |
_this._resetTransition(); | |
}, 1000); | |
} | |
}, | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment