mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-09 11:48:12 +08:00
add truncation to loading (#1320)
This commit is contained in:
@@ -106,6 +106,11 @@ class Category extends React.Component {
|
|||||||
We are still loading this category, so render a "busy" signal.
|
We are still loading this category, so render a "busy" signal.
|
||||||
*/
|
*/
|
||||||
const { metadataField } = this.props;
|
const { metadataField } = this.props;
|
||||||
|
const truncatedString = maybeTruncateString(
|
||||||
|
metadataField,
|
||||||
|
globals.categoryDisplayStringMaxLength
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
@@ -130,14 +135,26 @@ class Category extends React.Component {
|
|||||||
<input disabled checked={true} type="checkbox" />
|
<input disabled checked={true} type="checkbox" />
|
||||||
<span className="bp3-control-indicator" />
|
<span className="bp3-control-indicator" />
|
||||||
</label>
|
</label>
|
||||||
<span
|
<Tooltip
|
||||||
style={{
|
content={metadataField}
|
||||||
cursor: "pointer",
|
disabled={truncatedString === null}
|
||||||
display: "inline-block"
|
hoverOpenDelay={globals.tooltipHoverOpenDelayQuick}
|
||||||
|
position={Position.LEFT}
|
||||||
|
usePortal
|
||||||
|
modifiers={{
|
||||||
|
preventOverflow: { enabled: false },
|
||||||
|
hide: { enabled: false }
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{metadataField}
|
<span
|
||||||
</span>
|
style={{
|
||||||
|
cursor: "pointer",
|
||||||
|
display: "inline-block"
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{truncatedString || metadataField}
|
||||||
|
</span>
|
||||||
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<Button minimal loading intent="primary" />
|
<Button minimal loading intent="primary" />
|
||||||
|
|||||||
Reference in New Issue
Block a user