aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-05-15 16:09:47 -0400
committerbob <bcz@cs.brown.edu>2019-05-15 16:09:47 -0400
commit09afa3cc843a69eca59b63018e6f50f8e2bee089 (patch)
treea481eca8aecc4b8f59d755281cc2aa43453cc6e3 /src/client/views/nodes/CollectionFreeFormDocumentView.tsx
parentd79d721baa25947dfbbd17eda173835d9ae93fa6 (diff)
small fixes. stopped view from panning when switching to tab dragging.
Diffstat (limited to 'src/client/views/nodes/CollectionFreeFormDocumentView.tsx')
-rw-r--r--src/client/views/nodes/CollectionFreeFormDocumentView.tsx9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
index 38ac5cb90..631bf1ba8 100644
--- a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
+++ b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
@@ -170,7 +170,9 @@ export class CollectionFreeFormDocumentView extends DocComponent<CollectionFreeF
onPointerDown = (e: React.PointerEvent): void => {
this._downX = e.clientX;
this._downY = e.clientY;
- // e.stopPropagation();
+ if (e.button === 0 && e.altKey) {
+ e.stopPropagation(); // prevents panning from happening on collection if shift is pressed after a document drag has started
+ } // allow pointer down to go through otherwise so that marquees can be drawn starting over a document
}
onClick = async (e: React.MouseEvent) => {
e.stopPropagation();
@@ -192,14 +194,15 @@ export class CollectionFreeFormDocumentView extends DocComponent<CollectionFreeF
// ...(maximizedDocs ? maximizedDocs : []),
// ...(summarizedDocs ? summarizedDocs : []),];
if (expandedDocs.length) { // bcz: need a better way to associate behaviors with click events on widget-documents
- if ((altKey && !this.props.Document.maximizeOnRight) || (!altKey && this.props.Document.maximizeOnRight)) {
+ let hasView = expandedDocs.length === 1 && DocumentManager.Instance.getDocumentView(expandedDocs[0].proto!);
+ if (!hasView && ((altKey && !this.props.Document.maximizeOnRight) || (!altKey && this.props.Document.maximizeOnRight))) {
let dataDocs = DocListCast(CollectionDockingView.Instance.props.Document.data);
if (dataDocs) {
SelectionManager.DeselectAll();
expandedDocs.forEach(maxDoc => {
maxDoc.isMinimized = false;
if (!CollectionDockingView.Instance.CloseRightSplit(maxDoc)) {
- CollectionDockingView.Instance.AddRightSplit(Doc.MakeCopy(maxDoc));
+ CollectionDockingView.Instance.AddRightSplit(maxDoc.proto ? Doc.MakeDelegate(maxDoc.proto) : maxDoc);
}
});
}