aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/DocumentManager.ts
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-09-19 11:29:11 -0400
committerbob <bcz@cs.brown.edu>2019-09-19 11:29:11 -0400
commit2cdca63ac039a7c66a9c93acb35fe51467269e64 (patch)
treeb0916460d0df324596432e0e1d4f61fff889bd40 /src/client/util/DocumentManager.ts
parentbf4f4cb2e2997cb0ff6c86eef68b3d6b0310f319 (diff)
switche calls to COllectionDockingView... to addDocTabs. fixed following links to navigate/restore properly.
Diffstat (limited to 'src/client/util/DocumentManager.ts')
-rw-r--r--src/client/util/DocumentManager.ts15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index ec731da84..65ab32539 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -10,6 +10,7 @@ import { DocumentView } from '../views/nodes/DocumentView';
import { LinkManager } from './LinkManager';
import { undoBatch, UndoManager } from './UndoManager';
import { Scripting } from './Scripting';
+import { emptyFunction } from '../../Utils';
export class DocumentManager {
@@ -146,6 +147,7 @@ export class DocumentManager {
if (!contextDoc) {
let docs = docContext ? await DocListCastAsync(docContext.data) : undefined;
let found = false;
+ // bcz: this just searches within the context for the target -- perhaps it should recursively search through all children?
docs && docs.map(d => found = found || Doc.AreProtosEqual(d, docDelegate));
if (docContext && found) {
let targetContextView: DocumentView | null;
@@ -154,16 +156,19 @@ export class DocumentManager {
docContext.panTransformType = "Ease";
targetContextView.props.focus(docDelegate, willZoom);
} else {
- (dockFunc || CollectionDockingView.Instance.AddRightSplit)(docContext, undefined);
+ (dockFunc || CollectionDockingView.AddRightSplit)(docContext, undefined);
setTimeout(() => {
- this.jumpToDocument(docDelegate, willZoom, forceDockFunc, dockFunc, linkPage);
- }, 10);
+ let dv = DocumentManager.Instance.getDocumentView(docContext);
+ dv && this.jumpToDocument(docDelegate, willZoom, forceDockFunc,
+ doc => dv!.props.focus(dv!.props.Document, true, 1, () => dv!.props.addDocTab(doc, undefined, "inPlace")),
+ linkPage);
+ }, 1050);
}
} else {
const actualDoc = Doc.MakeAlias(docDelegate);
Doc.BrushDoc(actualDoc);
if (linkPage !== undefined) actualDoc.curPage = linkPage;
- (dockFunc || CollectionDockingView.Instance.AddRightSplit)(actualDoc, undefined);
+ (dockFunc || CollectionDockingView.AddRightSplit)(actualDoc, undefined);
}
} else {
let contextView: DocumentView | null;
@@ -172,7 +177,7 @@ export class DocumentManager {
contextDoc.panTransformType = "Ease";
contextView.props.focus(docDelegate, willZoom);
} else {
- (dockFunc || CollectionDockingView.Instance.AddRightSplit)(contextDoc, undefined);
+ (dockFunc || CollectionDockingView.AddRightSplit)(contextDoc, undefined);
setTimeout(() => {
this.jumpToDocument(docDelegate, willZoom, forceDockFunc, dockFunc, linkPage);
}, 10);