aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionViewBase.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/collections/CollectionViewBase.tsx')
-rw-r--r--src/client/views/collections/CollectionViewBase.tsx14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/client/views/collections/CollectionViewBase.tsx b/src/client/views/collections/CollectionViewBase.tsx
index 7e269caf1..be3cb0d5f 100644
--- a/src/client/views/collections/CollectionViewBase.tsx
+++ b/src/client/views/collections/CollectionViewBase.tsx
@@ -43,11 +43,21 @@ export class CollectionViewBase extends React.Component<SubCollectionViewProps>
@action
protected drop(e: Event, de: DragManager.DropEvent) {
const doc: DocumentView = de.data["document"];
+ if (de.data["alias"]) {
+ let newDoc = doc.props.Document.CreateAlias()
+ const xOffset = de.data["xOffset"] as number || 0
+ const yOffset = de.data["yOffset"] as number || 0
+ newDoc.SetNumber(KeyStore.X, de.x - xOffset)
+ newDoc.SetNumber(KeyStore.Y, de.y - yOffset)
+ newDoc.SetNumber(KeyStore.Width, doc.props.Document.GetNumber(KeyStore.Width, 100))
+ newDoc.SetNumber(KeyStore.Height, doc.props.Document.GetNumber(KeyStore.Height, 100))
+ this.props.addDocument(newDoc)
+ }
if (doc.props.ContainingCollectionView && doc.props.ContainingCollectionView !== this.props.CollectionView) {
- if (doc.props.RemoveDocument) {
+ if (!de.data["alias"] && doc.props.RemoveDocument) {
doc.props.RemoveDocument(doc.props.Document);
}
- this.props.addDocument(doc.props.Document);
+ this.props.addDocument(de.data["alias"] ? doc.props.Document.CreateAlias() : doc.props.Document);
}
e.stopPropagation();
}