diff options
author | bobzel <zzzman@gmail.com> | 2021-02-10 16:06:53 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-02-10 16:06:53 -0500 |
commit | 0f560a9032076d1ed096740e04a54d484ee0aaf6 (patch) | |
tree | be357a48287aa45a3526ff85214aaf27a35b7830 /src/client/views/nodes/DocumentContentsView.tsx | |
parent | 5e9faf9fc5a2aeb3b5c0377b756a746934097619 (diff) |
fixes for stacking views to allow new text to be entered properly without losing focus. fixed document decorations for stacking views. fixed lightboxView criteria for going to an existing view in a lightbox instad of creating a new one.
Diffstat (limited to 'src/client/views/nodes/DocumentContentsView.tsx')
-rw-r--r-- | src/client/views/nodes/DocumentContentsView.tsx | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/client/views/nodes/DocumentContentsView.tsx b/src/client/views/nodes/DocumentContentsView.tsx index 6ecd70330..4b4720d58 100644 --- a/src/client/views/nodes/DocumentContentsView.tsx +++ b/src/client/views/nodes/DocumentContentsView.tsx @@ -111,7 +111,6 @@ export class DocumentContentsView extends React.Component<DocumentViewProps & Fo scaling?: () => number, layoutKey: string, hideOnLeave?: boolean, - makeLink?: () => Opt<Doc>, // function to call when a link is made }> { @computed get layout(): string { TraceMobx(); @@ -141,16 +140,17 @@ export class DocumentContentsView extends React.Component<DocumentViewProps & Fo CreateBindings(onClick: Opt<ScriptField>, onInput: Opt<ScriptField>): JsxBindings { const docOnlyProps = [ // these are the properties in DocumentViewProps that need to be removed to pass on only DocumentSharedViewProps to the FieldViews "freezeDimensions", + "hideResizeHandles", "hideTitle", "treeViewDoc", - "dragDivName", "contentPointerEvents", "radialMenu", "LayoutTemplateString", "LayoutTemplate", + "dontCenter", "ContentScaling", - "contentFittingScaling", "contextMenuItems", + "onClick", "onDoubleClick", "onPointerDown", "onPointerUp", @@ -166,7 +166,11 @@ export class DocumentContentsView extends React.Component<DocumentViewProps & Fo return { props: list }; } - render() { + componentWillUpdate(oldProps: any, newState: any) { + // console.log("willupdate", oldProps, this.props); // bcz: if you get a message saying something invalidated because reactive props changed, then this method allows you to figure out which prop changed + } + + @computed get renderData() { TraceMobx(); let layoutFrame = this.layout; @@ -201,9 +205,14 @@ export class DocumentContentsView extends React.Component<DocumentViewProps & Fo }; const onClick = makeFuncProp("onClick"); const onInput = makeFuncProp("onInput"); - const bindings = this.CreateBindings(onClick, onInput); - // layoutFrame = splits.length > 1 ? splits[0] + splits[1].replace(/{([^{}]|(?R))*}/, replacer4) : ""; // might have been more elegant if javascript supported recursive patterns + return { bindings, layoutFrame }; + } + + render() { + TraceMobx(); + const { bindings, layoutFrame } = this.renderData; + return (this.props.renderDepth > 12 || !layoutFrame || !this.layoutDoc || GetEffectiveAcl(this.layoutDoc) === AclPrivate) ? (null) : <ObserverJsxParser key={42} |