aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/DocumentManager.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-02-25 13:38:31 -0500
committerbobzel <zzzman@gmail.com>2021-02-25 13:38:31 -0500
commit17ee7f6f1f61a079ec79b71aebc65abfd72ec32a (patch)
treea679cb0dfd57c911575cfecba6ae28329bcca6d7 /src/client/util/DocumentManager.ts
parentc4c3764397eb1ab12c93ea3e07483b436e87d736 (diff)
added an aliases toggle to file system
Diffstat (limited to 'src/client/util/DocumentManager.ts')
-rw-r--r--src/client/util/DocumentManager.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index 67e05f8d0..637e219d5 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -10,6 +10,8 @@ import { LightboxView } from '../views/LightboxView';
import { DocumentView, ViewAdjustment } from '../views/nodes/DocumentView';
import { Scripting } from './Scripting';
import { CurrentUserUtils } from './CurrentUserUtils';
+import { TabDocView } from '../views/collections/TabDocView';
+import { UndoManager } from './UndoManager';
export class DocumentManager {
@@ -219,4 +221,12 @@ export class DocumentManager {
}
}
-Scripting.addGlobal(function DocFocus(doc: any) { DocumentManager.Instance.getDocumentViews(Doc.GetProto(doc)).map(view => view.props.focus(doc, { willZoom: true })); }); \ No newline at end of file
+Scripting.addGlobal(function DocFocus(doc: any) {
+ const dv = DocumentManager.Instance.getDocumentView(doc);
+ if (dv && dv?.props.Document === doc) dv.props.focus(doc, { willZoom: true });
+ else {
+ const context = Cast(doc.context, Doc, null);
+ CollectionDockingView.AddSplit(context || doc, "right") && context &&
+ setTimeout(() => DocumentManager.Instance.getDocumentView(Doc.GetProto(doc))?.focus(doc));
+ }
+}); \ No newline at end of file