aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionMulticolumn/MultirowHeightLabel.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-02-03 23:48:06 -0500
committerBob Zeleznik <zzzman@gmail.com>2020-02-03 23:48:06 -0500
commit6247bfe9aee9ea7f1a04b1aa154d22629a927042 (patch)
tree89b336b6f41e66aad1965b14b3727eb609e4f811 /src/client/views/collections/collectionMulticolumn/MultirowHeightLabel.tsx
parente42c6b732decff0d8903c8613b9021dbd8ddf3e0 (diff)
parent11b4645ce52df01f071a9a4a2582cae10a0140ba (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/views/collections/collectionMulticolumn/MultirowHeightLabel.tsx')
-rw-r--r--src/client/views/collections/collectionMulticolumn/MultirowHeightLabel.tsx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/views/collections/collectionMulticolumn/MultirowHeightLabel.tsx b/src/client/views/collections/collectionMulticolumn/MultirowHeightLabel.tsx
index 56a2e868d..899577fd5 100644
--- a/src/client/views/collections/collectionMulticolumn/MultirowHeightLabel.tsx
+++ b/src/client/views/collections/collectionMulticolumn/MultirowHeightLabel.tsx
@@ -4,7 +4,7 @@ import { computed } from "mobx";
import { Doc } from "../../../../new_fields/Doc";
import { NumCast, StrCast, BoolCast } from "../../../../new_fields/Types";
import { EditableView } from "../../EditableView";
-import { HeightUnit } from "./CollectionMultirowView";
+import { DimUnit } from "./CollectionMultirowView";
interface HeightLabelProps {
layout: Doc;
@@ -18,8 +18,8 @@ export default class HeightLabel extends React.Component<HeightLabelProps> {
@computed
private get contents() {
const { layout, decimals } = this.props;
- const getUnit = () => StrCast(layout.heightUnit);
- const getMagnitude = () => String(+NumCast(layout.heightMagnitude).toFixed(decimals ?? 3));
+ const getUnit = () => StrCast(layout.dimUnit);
+ const getMagnitude = () => String(+NumCast(layout.dimMagnitude).toFixed(decimals ?? 3));
return (
<div className={"label-wrapper"}>
<EditableView
@@ -27,7 +27,7 @@ export default class HeightLabel extends React.Component<HeightLabelProps> {
SetValue={value => {
const converted = Number(value);
if (!isNaN(converted) && converted > 0) {
- layout.heightMagnitude = converted;
+ layout.dimMagnitude = converted;
return true;
}
return false;
@@ -37,8 +37,8 @@ export default class HeightLabel extends React.Component<HeightLabelProps> {
<EditableView
GetValue={getUnit}
SetValue={value => {
- if (Object.values(HeightUnit).includes(value)) {
- layout.heightUnit = value;
+ if (Object.values(DimUnit).includes(value)) {
+ layout.dimUnit = value;
return true;
}
return false;