Fixed the node details spinner Chrome display bug

This commit is contained in:
Filip Barl
2017-02-01 17:27:43 +01:00
parent 4bc6a6c128
commit 2a8904e5f2
2 changed files with 12 additions and 2 deletions

View File

@@ -57,7 +57,12 @@ class DetailsCard extends React.Component {
return (
<div className="details-wrapper" style={style}>
{showingTerminal && <EmbeddedTerminal />}
<NodeDetails nodeId={this.props.id} key={this.props.id} {...this.props} />
<NodeDetails
key={this.props.id}
nodeId={this.props.id}
mounted={this.state.mounted}
{...this.props}
/>
</div>
);
}

View File

@@ -1,5 +1,6 @@
import debug from 'debug';
import React from 'react';
import classNames from 'classnames';
import { connect } from 'react-redux';
import { Map as makeMap } from 'immutable';
@@ -73,6 +74,10 @@ class NodeDetails extends React.Component {
renderLoading() {
const node = this.props.nodes.get(this.props.nodeId);
const label = node ? node.get('label') : this.props.label;
// NOTE: If we start the fa-spin animation before the node details panel has been
// mounted, the spinner is displayed blurred the whole time in Chrome (possibly
// caused by a bug having to do with animating the details panel).
const spinnerClassName = classNames('fa fa-circle-o-notch', { 'fa-spin': this.props.mounted });
const nodeColor = (node ?
getNodeColorDark(node.get('rank'), label, node.get('pseudo')) :
getNeutralColor());
@@ -98,7 +103,7 @@ class NodeDetails extends React.Component {
</div>
<div className="node-details-content">
<div className="node-details-content-loading">
<span className="fa fa-circle-o-notch fa-spin" />
<span className={spinnerClassName} />
</div>
</div>
</div>