diff options
author | bobzel <zzzman@gmail.com> | 2023-03-27 18:21:13 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-03-27 18:21:13 -0400 |
commit | 8ab9236664c561d54d6a41ecb1eb2eaf6064fc0c (patch) | |
tree | e403baa003393047dc6e1bbee9d41658d59cb9ff /src/client/views/nodes/LinkBox.tsx | |
parent | c70a4c82501a318136b04623f92b35461014b179 (diff) |
changed longPress to always select and to show decorations. fixed single/double-click code and cleaned up behavior timeouts. fixed pointer events for tree view editing titles and using as powerpoint.
Diffstat (limited to 'src/client/views/nodes/LinkBox.tsx')
-rw-r--r-- | src/client/views/nodes/LinkBox.tsx | 54 |
1 files changed, 32 insertions, 22 deletions
diff --git a/src/client/views/nodes/LinkBox.tsx b/src/client/views/nodes/LinkBox.tsx index 43f4b43fb..470f7e803 100644 --- a/src/client/views/nodes/LinkBox.tsx +++ b/src/client/views/nodes/LinkBox.tsx @@ -1,29 +1,39 @@ -import React = require("react"); -import { observer } from "mobx-react"; -import { emptyFunction, returnFalse } from "../../../Utils"; -import { ViewBoxBaseComponent } from "../DocComponent"; -import { StyleProp } from "../StyleProvider"; -import { ComparisonBox } from "./ComparisonBox"; +import React = require('react'); +import { observer } from 'mobx-react'; +import { emptyFunction, returnFalse, returnTrue } from '../../../Utils'; +import { ViewBoxBaseComponent } from '../DocComponent'; +import { StyleProp } from '../StyleProvider'; +import { ComparisonBox } from './ComparisonBox'; import { FieldView, FieldViewProps } from './FieldView'; -import "./LinkBox.scss"; +import './LinkBox.scss'; @observer export class LinkBox extends ViewBoxBaseComponent<FieldViewProps>() { - public static LayoutString(fieldKey: string) { return FieldView.LayoutString(LinkBox, fieldKey); } + public static LayoutString(fieldKey: string) { + return FieldView.LayoutString(LinkBox, fieldKey); + } isContentActiveFunc = () => this.isContentActive(); + + onClickScriptDisable: () => 'always' = () => 'always'; + componentDidMount() { + this.props.setContentView?.(this); + } render() { - 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) }} > - <ComparisonBox {...this.props} - fieldKey="anchor" - setHeight={emptyFunction} - dontRegisterView={true} - renderDepth={this.props.renderDepth + 1} - isContentActive={this.isContentActiveFunc} - addDocument={returnFalse} - removeDocument={returnFalse} - moveDocument={returnFalse} /> - </div>; + 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) }}> + <ComparisonBox + {...this.props} + fieldKey="anchor" + setHeight={emptyFunction} + dontRegisterView={true} + renderDepth={this.props.renderDepth + 1} + isContentActive={this.isContentActiveFunc} + addDocument={returnFalse} + removeDocument={returnFalse} + moveDocument={returnFalse} + /> + </div> + ); } -}
\ No newline at end of file +} |