aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DocumentView.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-05-16 22:56:19 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-05-16 22:56:19 -0400
commit6e65b1e32eb972358d9c8dbd7f8d984d3baefc4b (patch)
treebdabcfc70b90e943e3aaf9ab8b93a916cabd007d /src/client/views/nodes/DocumentView.tsx
parent0c019112791138304eaaeea768d254981322ec55 (diff)
fixed links so that you can adjust the pan location of a collection when its a link endoint
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r--src/client/views/nodes/DocumentView.tsx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index 40ad55d25..5264773b0 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -27,6 +27,7 @@ import { DocServer } from "../../DocServer";
import { Id } from "../../../new_fields/RefField";
import { PresentationView } from "../PresentationView";
import { SearchUtil } from "../../util/SearchUtil";
+import { ObjectField, Copy } from "../../../new_fields/ObjectField";
const linkSchema = createSchema({
title: "string",
@@ -245,17 +246,17 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu
let sourceDoc = de.data.linkSourceDocument;
let destDoc = this.props.Document;
- const protoDest = destDoc.proto;
- const protoSrc = sourceDoc.proto;
- if (de.mods === "Control") {
+ if (de.mods === "AltKey") {
+ const protoDest = destDoc.proto;
+ const protoSrc = sourceDoc.proto;
let src = protoSrc ? protoSrc : sourceDoc;
let dst = protoDest ? protoDest : destDoc;
- dst.data = src;
+ dst.data = (src.data! as ObjectField)[Copy]();
dst.nativeWidth = src.nativeWidth;
dst.nativeHeight = src.nativeHeight;
}
else {
- Doc.MakeLink(protoSrc ? protoSrc : sourceDoc, protoDest ? protoDest : destDoc);
+ Doc.MakeLink(sourceDoc, destDoc);
de.data.droppedDocuments.push(destDoc);
}
e.stopPropagation();