aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-04-09 08:46:15 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-04-09 08:46:15 -0400
commit78e098c4ecb95b90482e7d27fd82fb857de96bb4 (patch)
tree286cbadb444381d8cc7e2da5bbd53951a9e7e915 /src
parenta63a3f912f8857963cd5cc14cf1e73f645eb3477 (diff)
fixed dragging linkbutton to show linked docs
Diffstat (limited to 'src')
-rw-r--r--src/client/views/DocumentDecorations.tsx7
-rw-r--r--src/client/views/collections/CollectionViewBase.tsx18
2 files changed, 3 insertions, 22 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 4a7502072..40da98d34 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -266,7 +266,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
if (doc)
moddrag.push(doc);
}
- let dragData = new DragManager.DocumentDragData(moddrag);
+ let dragData = new DragManager.DocumentDragData(moddrag.length ? moddrag : draggedDocs);
DragManager.StartDocumentDrag([this._linkButton.current], dragData, e.x, e.y, {
handlers: {
dragComplete: action(() => { }),
@@ -407,9 +407,8 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
let linkCount = linkToSize + linkFromSize;
linkButton = (<Flyout
anchorPoint={anchorPoints.RIGHT_TOP}
- content={
- <LinkMenu docView={selFirst} changeFlyout={this.changeFlyoutContent} />
- }>
+ content={<LinkMenu docView={selFirst}
+ changeFlyout={this.changeFlyoutContent} />}>
<div className={"linkButton-" + (selFirst.props.Document.GetData(KeyStore.LinkedToDocs, ListField, []).length ? "nonempty" : "empty")} onPointerDown={this.onLinkButtonDown} >{linkCount}</div>
</Flyout>);
}
diff --git a/src/client/views/collections/CollectionViewBase.tsx b/src/client/views/collections/CollectionViewBase.tsx
index 7cf49e215..1f16e8313 100644
--- a/src/client/views/collections/CollectionViewBase.tsx
+++ b/src/client/views/collections/CollectionViewBase.tsx
@@ -94,24 +94,6 @@ export class CollectionViewBase extends React.Component<SubCollectionViewProps>
e.stopPropagation();
return added;
}
- if (de.data instanceof DragManager.LinkDragData) {
- let sourceDoc: Document = de.data.linkSourceDocumentView.props.Document;
- if (sourceDoc) runInAction(() => {
- let srcTarg = sourceDoc.GetT(KeyStore.Prototype, Document)
- if (srcTarg && srcTarg != FieldWaiting) {
- let linkDocs = srcTarg.GetList(KeyStore.LinkedToDocs, [] as Document[]);
- linkDocs.map(linkDoc => {
- let targDoc = linkDoc.GetT(KeyStore.LinkedToDocs, Document);
- if (targDoc && targDoc != FieldWaiting) {
- let dropdoc = targDoc.MakeDelegate();
- de.data.droppedDocuments.push(dropdoc);
- this.props.addDocument(dropdoc, false);
- }
- })
- }
- })
- return true;
- }
return false;
}