Skip to content

Commit

Permalink
Fixed the node details spinner Chrome display bug
Browse files Browse the repository at this point in the history
  • Loading branch information
fbarl committed Feb 2, 2017
1 parent 834eb61 commit 610d596
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion client/app/scripts/components/details-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>
);
}
Expand Down
7 changes: 6 additions & 1 deletion client/app/scripts/components/node-details.js
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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());
Expand All @@ -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>
Expand Down

0 comments on commit 610d596

Please sign in to comment.