diff options
Diffstat (limited to 'src/client/views/nodes/LinkBox.tsx')
-rw-r--r-- | src/client/views/nodes/LinkBox.tsx | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/client/views/nodes/LinkBox.tsx b/src/client/views/nodes/LinkBox.tsx index f542652d0..c65ba9c69 100644 --- a/src/client/views/nodes/LinkBox.tsx +++ b/src/client/views/nodes/LinkBox.tsx @@ -1,14 +1,13 @@ import React = require("react"); import { observer } from "mobx-react"; import { documentSchema } from "../../../fields/documentSchemas"; -import { makeInterface, listSpec } from "../../../fields/Schema"; -import { returnFalse, returnZero } from "../../../Utils"; +import { makeInterface } from "../../../fields/Schema"; +import { returnFalse } from "../../../Utils"; import { CollectionTreeView } from "../collections/CollectionTreeView"; import { ViewBoxBaseComponent } from "../DocComponent"; +import { StyleProp } from "../StyleProvider"; import { FieldView, FieldViewProps } from './FieldView'; import "./LinkBox.scss"; -import { Cast } from "../../../fields/Types"; -import { StyleProp } from "../StyleProvider"; type LinkDocument = makeInterface<[typeof documentSchema]>; const LinkDocument = makeInterface(documentSchema); @@ -16,16 +15,22 @@ const LinkDocument = makeInterface(documentSchema); @observer export class LinkBox extends ViewBoxBaseComponent<FieldViewProps, LinkDocument>(LinkDocument) { public static LayoutString(fieldKey: string) { return FieldView.LayoutString(LinkBox, fieldKey); } + isContentActiveFunc = () => this.isContentActive() ? true : false; render() { - return <div className={`linkBox-container${this.active() ? "-interactive" : ""}`} - style={{ background: this.props.styleProvider?.(this.props.Document, this.props, StyleProp.BackgroundColor) }} > - + if (this.dataDoc.treeViewOpen === undefined) setTimeout(() => this.dataDoc.treeViewOpen = true); + return <div className={`linkBox-container${this.isContentActive() ? "-interactive" : ""}`} + style={{ background: this.props.styleProvider?.(this.layoutDoc, this.props, StyleProp.BackgroundColor) }} > <CollectionTreeView {...this.props} childDocuments={[this.dataDoc]} - treeViewSkipFields={Cast(this.props.Document.linkBoxExcludedKeys, listSpec("string"), null)} + treeViewOpen={true} + treeViewExpandedView={"fields"} + treeViewHideTitle={true} + treeViewSkipFields={["treeViewExpandedView", "aliases", "_removeDropProperties", + "treeViewOpen", "aliasNumber", "isPrototype", "creationDate", "author"]} dontRegisterView={true} renderDepth={this.props.renderDepth + 1} CollectionView={undefined} + isContentActive={this.isContentActiveFunc} addDocument={returnFalse} removeDocument={returnFalse} moveDocument={returnFalse}> |