diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-04-30 19:48:36 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-04-30 19:48:36 -0400 |
commit | 3ed9fbefe1428c1493027122791ccbbe1b2fe1d1 (patch) | |
tree | adac80637e3824bcb8f54bca5929c1175fdabb95 /src | |
parent | 7d4a4b25459b66568880528cd3776b6ff9cbcf9f (diff) |
fixed link document
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/FormattedTextBox.scss | 6 | ||||
-rw-r--r-- | src/client/views/nodes/FormattedTextBox.tsx | 8 | ||||
-rw-r--r-- | src/new_fields/Doc.ts | 8 |
3 files changed, 11 insertions, 11 deletions
diff --git a/src/client/views/nodes/FormattedTextBox.scss b/src/client/views/nodes/FormattedTextBox.scss index 727d3c0b2..d43aa4e02 100644 --- a/src/client/views/nodes/FormattedTextBox.scss +++ b/src/client/views/nodes/FormattedTextBox.scss @@ -30,11 +30,11 @@ pointer-events: none; } .formattedTextBox-inner-rounded { - height: calc(100% - 40px); + height: calc(100% - 25px); width: calc(100% - 40px); position: absolute; - overflow: scroll; - top: 20; + overflow: auto; + top: 15; left: 20; } diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx index 9c6f95fc4..fe9696062 100644 --- a/src/client/views/nodes/FormattedTextBox.tsx +++ b/src/client/views/nodes/FormattedTextBox.tsx @@ -144,8 +144,8 @@ export class FormattedTextBox extends DocComponent<(FieldViewProps & FormattedTe private setupEditor(config: any, doc?: Doc) { let field = doc ? Cast(doc[this.props.fieldKey], RichTextField) : undefined; - if (this._ref.current) { - this._editorView = new EditorView(this._ref.current, { + if (this._proseRef.current) { + this._editorView = new EditorView(this._proseRef.current, { state: field && field.Data ? EditorState.fromJSON(config, JSON.parse(field.Data)) : EditorState.create(config), dispatchTransaction: this.dispatchTransaction }); @@ -195,8 +195,8 @@ export class FormattedTextBox extends DocComponent<(FieldViewProps & FormattedTe if (!this.props.isOverlay) { MainOverlayTextBox.Instance.SetTextDoc(this.props.Document, this.props.fieldKey, this._ref.current!, this.props.ScreenToLocalTransform); } else { - if (this._ref.current) { - this._ref.current.scrollTop = MainOverlayTextBox.Instance.TextScroll; + if (this._proseRef.current) { + this._proseRef.current.scrollTop = MainOverlayTextBox.Instance.TextScroll; } } } diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index 64cc6d270..c4ad5ae95 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -1,7 +1,6 @@ import { observable, action } from "mobx"; import { serializable, primitive, map, alias, list } from "serializr"; import { autoObject, SerializationHelper, Deserializable } from "../client/util/SerializationHelper"; -import { Utils } from "../Utils"; import { DocServer } from "../client/DocServer"; import { setter, getter, getField, updateFunction, deleteProperty } from "./util"; import { Cast, ToConstructor, PromiseValue, FieldValue, NumCast } from "./Types"; @@ -10,6 +9,7 @@ import { listSpec } from "./Schema"; import { List } from "./List"; import { ObjectField, Parent, OnUpdate } from "./ObjectField"; import { RefField, FieldId, Id } from "./RefField"; +import { Docs } from "../client/documents/Documents"; export function IsField(field: any): field is Field { return (typeof field === "string") @@ -163,9 +163,9 @@ export namespace Doc { return copy; } - export function MakeLink(source: Doc, target: Doc): Doc { - return UndoManager.RunInBatch(() => { - let linkDoc = new Doc; + export function MakeLink(source: Doc, target: Doc) { + UndoManager.RunInBatch(() => { + let linkDoc = Docs.TextDocument({ width: 100, height: 30, borderRounding: -1 }); linkDoc.title = "New Link"; linkDoc.linkDescription = ""; linkDoc.linkTags = "Default"; |