From d5304e13839830c60c0c5698849535b0605e3c32 Mon Sep 17 00:00:00 2001 From: bob Date: Mon, 18 Mar 2019 10:28:43 -0400 Subject: fixed drag drop and loading of pdfs --- src/client/views/collections/CollectionViewBase.tsx | 1 + src/client/views/nodes/DocumentView.tsx | 4 +++- src/client/views/nodes/PDFBox.tsx | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/client') diff --git a/src/client/views/collections/CollectionViewBase.tsx b/src/client/views/collections/CollectionViewBase.tsx index fd0e84fb1..3d1a76a07 100644 --- a/src/client/views/collections/CollectionViewBase.tsx +++ b/src/client/views/collections/CollectionViewBase.tsx @@ -57,6 +57,7 @@ export class CollectionViewBase extends React.Component } }) ); + de.data["document"] = doc; this.props.addDocument(doc); } else if (docView) { if (doc && docView.props.RemoveDocument && docView.props.ContainingCollectionView !== this.props.CollectionView) { diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 6a3967b3b..fbd58ef7e 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -165,7 +165,9 @@ export class DocumentView extends React.Component { const [left, top] = this.props.ScreenToLocalTransform().inverse().transformPoint(0, 0); let dragData: { [id: string]: any } = {}; dragData["documentView"] = this; - dragData[dropAliasOfDraggedDoc ? "documentToAlias" : "document"] = this.props.Document; + if (dropAliasOfDraggedDoc) + dragData["documentToAlias"] = this.props.Document; + dragData["document"] = this.props.Document; dragData["xOffset"] = x - left; dragData["yOffset"] = y - top; DragManager.StartDrag(this._mainCont.current, dragData, { diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx index b0b5a63a4..b9d260380 100644 --- a/src/client/views/nodes/PDFBox.tsx +++ b/src/client/views/nodes/PDFBox.tsx @@ -96,7 +96,7 @@ export class PDFBox extends React.Component { this.saveThumbnail(); this._interactive = true; } else { - if (this.curPage) + if (this.curPage > 0) this.initPage = true; } }, -- cgit v1.2.3-70-g09d2