diff options
author | ab <abdullah_ahmed@brown.edu> | 2019-11-16 12:28:12 -0500 |
---|---|---|
committer | ab <abdullah_ahmed@brown.edu> | 2019-11-16 12:28:12 -0500 |
commit | f7e101dfc7bc9e81ca03730865740360a831285a (patch) | |
tree | 8fd94d15bf573890882d746cbca065bfd5993cb9 /src/client/views/CollectionLinearView.tsx | |
parent | d26e058019d878d3058cb3806855281076b8d411 (diff) | |
parent | 22d1e65236bae11c508d5c34ebcbddd1a552bfd8 (diff) |
merged
Diffstat (limited to 'src/client/views/CollectionLinearView.tsx')
-rw-r--r-- | src/client/views/CollectionLinearView.tsx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/client/views/CollectionLinearView.tsx b/src/client/views/CollectionLinearView.tsx index e8ef20899..7c6d33d36 100644 --- a/src/client/views/CollectionLinearView.tsx +++ b/src/client/views/CollectionLinearView.tsx @@ -1,21 +1,18 @@ import { action, IReactionDisposer, observable, reaction } from 'mobx'; import { observer } from 'mobx-react'; import * as React from 'react'; -import { Doc, HeightSym, WidthSym, DocListCast } from '../../new_fields/Doc'; -import { ObjectField } from '../../new_fields/ObjectField'; +import { Doc, HeightSym, WidthSym } from '../../new_fields/Doc'; import { makeInterface } from '../../new_fields/Schema'; -import { ScriptField } from '../../new_fields/ScriptField'; import { BoolCast, NumCast, StrCast } from '../../new_fields/Types'; import { emptyFunction, returnEmptyString, returnOne, returnTrue, Utils } from '../../Utils'; -import { Docs } from '../documents/Documents'; import { DragManager } from '../util/DragManager'; import { Transform } from '../util/Transform'; import "./CollectionLinearView.scss"; -import { CollectionViewType } from './collections/CollectionBaseView'; +import { CollectionViewType } from './collections/CollectionView'; import { CollectionSubView } from './collections/CollectionSubView'; -import { documentSchema, DocumentView } from './nodes/DocumentView'; -import { translate } from 'googleapis/build/src/apis/translate'; -import { DocumentType } from '../documents/DocumentTypes'; +import { DocumentView } from './nodes/DocumentView'; +import { documentSchema } from '../../new_fields/documentSchemas'; +import { Id } from '../../new_fields/FieldSymbols'; type LinearDocument = makeInterface<[typeof documentSchema,]>; @@ -71,7 +68,7 @@ export class CollectionLinearView extends CollectionSubView(LinearDocument) { let scalingContent = nested ? 1 : this.dimension() / (this._spacing + nativeWidth); let scalingBox = nested ? 1 : this.dimension() / nativeWidth; let deltaSize = nativeWidth * scalingBox - nativeWidth * scalingContent; - return <div className={`collectionLinearView-docBtn` + (pair.layout.onClick || pair.layout.onDragStart ? "-scalable" : "")} key={StrCast(pair.layout.title)} ref={dref} + return <div className={`collectionLinearView-docBtn` + (pair.layout.onClick || pair.layout.onDragStart ? "-scalable" : "")} key={pair.layout[Id]} ref={dref} style={{ width: nested ? pair.layout[WidthSym]() : this.dimension(), height: nested && pair.layout.isExpanded ? pair.layout[HeightSym]() : this.dimension(), |