aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-09-18 17:25:10 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-09-18 17:25:10 -0400
commit4652881dbdffefab2240a2a0a509f8505376f91b (patch)
tree5f037767e67583de39d277bfdd66d4762cc0da3b /src/client/views/collections
parent90e36ff4532bfc23831ad0b481c88c00cfac6ffe (diff)
cleaned up navigate into portal and alt-dragging to copy contents
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx13
-rw-r--r--src/client/views/collections/collectionFreeForm/MarqueeView.tsx2
2 files changed, 13 insertions, 2 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 359731bda..baf907634 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -607,7 +607,7 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) {
}
}
- focusDocument = (doc: Doc, willZoom: boolean, scale?: number) => {
+ focusDocument = (doc: Doc, willZoom: boolean, scale?: number, afterFocus?: () => boolean) => {
const state = HistoryUtil.getState();
// TODO This technically isn't correct if type !== "doc", as
// currently nothing is done, but we should probably push a new state
@@ -628,6 +628,10 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) {
const newState = HistoryUtil.getState();
newState.initializers![this.Document[Id]] = { panX: newPanX, panY: newPanY };
HistoryUtil.pushState(newState);
+
+ let px = this.Document.panX;
+ let py = this.Document.panY;
+ let s = this.Document.scale;
this.setPan(newPanX, newPanY);
this.props.Document.panTransformType = "Ease";
@@ -635,6 +639,13 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) {
if (willZoom) {
this.setScaleToZoom(doc, scale);
}
+ afterFocus && setTimeout(() => {
+ if (afterFocus && afterFocus()) {
+ this.Document.panX = px;
+ this.Document.panY = py;
+ this.Document.scale = s;
+ }
+ }, 1000);
}
setScaleToZoom = (doc: Doc, scale: number = 0.5) => {
diff --git a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
index 479e98840..18d0fea8c 100644
--- a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
+++ b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
@@ -329,7 +329,7 @@ export class MarqueeView extends React.Component<MarqueeViewProps>
let container = Docs.Create.FreeformDocument([summary, newCollection], { x: bounds.left, y: bounds.top, width: 300, height: 200, chromeStatus: "disabled", title: "-summary-" });
container.viewType = CollectionViewType.Stacking;
container.autoHeight = true;
- Doc.GetProto(summary).maximizeLocation = "inPlace"; // or "inPlace", or "onRight"
+ Doc.GetProto(summary).maximizeLocation = "inPlace"; // or "onRight"
this.props.addLiveTextDocument(container);
} else if (e.key === "S") { // the summary stands alone, but is linked to a collection of the summarized documents - set the OnCLick behavior to link follow to access them
Doc.GetProto(summary).maximizeLocation = "inTab"; // or "inPlace", or "onRight"