diff options
| author | Sam Wilkins <samwilkins333@gmail.com> | 2020-01-18 17:33:24 -0500 |
|---|---|---|
| committer | Sam Wilkins <samwilkins333@gmail.com> | 2020-01-18 17:33:24 -0500 |
| commit | ca7faa46af2bcbc6651891c8f1430dedea55b8be (patch) | |
| tree | 1bbfb0ae75f5f7cc4457a5ff0acb6e8d5e29ff43 /src/client/views/collections/collectionMulticolumn/MulticolumnResizer.tsx | |
| parent | 9e90f5cb1d481889def9fe22b7e5d152777ea95d (diff) | |
switched mcview labels to editable views
Diffstat (limited to 'src/client/views/collections/collectionMulticolumn/MulticolumnResizer.tsx')
| -rw-r--r-- | src/client/views/collections/collectionMulticolumn/MulticolumnResizer.tsx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/client/views/collections/collectionMulticolumn/MulticolumnResizer.tsx b/src/client/views/collections/collectionMulticolumn/MulticolumnResizer.tsx index aab98ecfd..11e210958 100644 --- a/src/client/views/collections/collectionMulticolumn/MulticolumnResizer.tsx +++ b/src/client/views/collections/collectionMulticolumn/MulticolumnResizer.tsx @@ -3,6 +3,7 @@ import { observer } from "mobx-react"; import { observable, action } from "mobx"; import { Doc } from "../../../../new_fields/Doc"; import { NumCast, StrCast } from "../../../../new_fields/Types"; +import { WidthUnit } from "./CollectionMulticolumnView"; interface ResizerProps { width: number; @@ -46,12 +47,12 @@ export default class ResizeBar extends React.Component<ResizerProps> { if (unitLength) { if (toNarrow) { const { widthUnit, widthMagnitude } = toNarrow; - const scale = widthUnit === "*" ? unitLength : 1; + const scale = widthUnit === WidthUnit.Ratio ? unitLength : 1; toNarrow.widthMagnitude = NumCast(widthMagnitude) - Math.abs(movementX) / scale; } if (this.resizeMode === ResizeMode.Pinned && toWiden) { const { widthUnit, widthMagnitude } = toWiden; - const scale = widthUnit === "*" ? unitLength : 1; + const scale = widthUnit === WidthUnit.Ratio ? unitLength : 1; toWiden.widthMagnitude = NumCast(widthMagnitude) + Math.abs(movementX) / scale; } } @@ -60,17 +61,17 @@ export default class ResizeBar extends React.Component<ResizerProps> { private get isActivated() { const { toLeft, toRight } = this.props; if (toLeft && toRight) { - if (StrCast(toLeft.widthUnit) === "px" && StrCast(toRight.widthUnit) === "px") { + if (StrCast(toLeft.widthUnit) === WidthUnit.Pixel && StrCast(toRight.widthUnit) === WidthUnit.Pixel) { return false; } return true; } else if (toLeft) { - if (StrCast(toLeft.widthUnit) === "px") { + if (StrCast(toLeft.widthUnit) === WidthUnit.Pixel) { return false; } return true; } else if (toRight) { - if (StrCast(toRight.widthUnit) === "px") { + if (StrCast(toRight.widthUnit) === WidthUnit.Pixel) { return false; } return true; |
