mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 02:00:43 +00:00
Set a timeout to Terminal animation
If the animation has no effect, `onTransitionEnd`'s handler is not be called. Since `onTransitionEnd`'s handler controls whether the terminal is shown or not (by passing `connect=true` as a Terminal prop), set the `animated` variable to true after a timeout. Please see: * https://stackoverflow.com/questions/2087510/callback-on-css-transition/11354026#11354026 * https://github.com/scttnlsn/backbone.viewkit/issues/4 * https://forums.xamarin.com/discussion/58456/why-isnt-my-transitionlistener-getting-called
This commit is contained in:
@@ -17,9 +17,17 @@ class EmeddedTerminal extends React.Component {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
setTimeout(() => {
|
||||
this.mountedTimeout = setTimeout(() => {
|
||||
this.setState({mounted: true});
|
||||
});
|
||||
this.animationTimeout = setTimeout(() => {
|
||||
this.setState({ animated: true });
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
clearTimeout(this.mountedTimeout);
|
||||
clearTimeout(this.animationTimeout);
|
||||
}
|
||||
|
||||
getTransform() {
|
||||
|
||||
Reference in New Issue
Block a user