aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-09-16 10:26:12 -0400
committerbobzel <zzzman@gmail.com>2021-09-16 10:26:12 -0400
commit1643bfbbbe25fbd721d19ff2b77e795c6a2609d3 (patch)
tree3ebec071e2a94073e6c66793f7235904aa60c722 /src
parent1395ce3fbf73bf5df5ed4add744c333cfc8008c9 (diff)
fixed unused code for embedding document references in text
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/formattedText/FormattedTextBox.tsx5
-rw-r--r--src/client/views/nodes/formattedText/RichTextRules.ts4
2 files changed, 5 insertions, 4 deletions
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
index caca215e5..3c2ff2df5 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx
+++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
@@ -462,10 +462,11 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp
const target = dragData.droppedDocuments[0];
target._fitToBox = true;
const node = schema.nodes.dashDoc.create({
- width: target[WidthSym](), height: target[HeightSym](),
+ width: target[WidthSym](),
+ height: target[HeightSym](),
title: "dashDoc",
docid: target[Id],
- float: "right"
+ float: "unset"
});
const view = this._editorView!;
view.dispatch(view.state.tr.insert(view.posAtCoords({ left: de.x, top: de.y })!.pos, node));
diff --git a/src/client/views/nodes/formattedText/RichTextRules.ts b/src/client/views/nodes/formattedText/RichTextRules.ts
index 3fd7d61fa..711136469 100644
--- a/src/client/views/nodes/formattedText/RichTextRules.ts
+++ b/src/client/views/nodes/formattedText/RichTextRules.ts
@@ -282,7 +282,7 @@ export class RichTextRules {
if (rstate) {
this.TextBox.EditorView?.dispatch(rstate.tr.setSelection(new TextSelection(rstate.doc.resolve(start), rstate.doc.resolve(end - 3))));
}
- const target = ((docx instanceof Doc) && docx) || Docs.Create.FreeformDocument([], { title: rawdocid, _width: 500, _height: 500, }, docid);
+ const target = ((docx instanceof Doc) && docx) || Docs.Create.FreeformDocument([], { title: rawdocid.replace(/^:/, ""), _width: 500, _height: 500, }, docid);
DocUtils.MakeLink({ doc: this.TextBox.getAnchor() }, { doc: target }, "portal to", undefined);
const fstate = this.TextBox.EditorView?.state;
@@ -290,7 +290,7 @@ export class RichTextRules {
this.TextBox.EditorView?.dispatch(fstate.tr.setSelection(new TextSelection(fstate.doc.resolve(selection))));
}
});
- return state.tr.deleteRange(end - 1, end).deleteRange(start, start + 2);
+ return state.tr.deleteRange(end - 1, end).deleteRange(start, start + 3);
}
return state.tr;
}