aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionDockingView.tsx
diff options
context:
space:
mode:
authorusodhi <61431818+usodhi@users.noreply.github.com>2021-02-18 16:31:21 -0500
committerusodhi <61431818+usodhi@users.noreply.github.com>2021-02-18 16:31:21 -0500
commitec18ae95005b9adc674a1ed6c3e976aa987ed7d2 (patch)
treeae991bbfad86ca6230a21c86b40c274e2cfe6607 /src/client/views/collections/CollectionDockingView.tsx
parent546540013de0a7cb647f30f1fcb513ce52048b72 (diff)
parent0d59f6bc23c755c4eab2503add28699f5a5b1992 (diff)
merging
Diffstat (limited to 'src/client/views/collections/CollectionDockingView.tsx')
-rw-r--r--src/client/views/collections/CollectionDockingView.tsx16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index eee939c07..550a4082b 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -21,9 +21,9 @@ import { CollectionSubView, SubCollectionViewProps } from "./CollectionSubView";
import { CollectionViewType } from './CollectionView';
import { TabDocView } from './TabDocView';
import React = require("react");
-import { stat } from 'fs';
import { DocumentType } from '../../documents/DocumentTypes';
import { listSpec } from '../../../fields/Schema';
+import { LightboxView } from '../LightboxView';
const _global = (window /* browser */ || global /* node */) as any;
@observer
@@ -375,13 +375,13 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) {
const sublists = DocListCast(this.props.Document[this.props.fieldKey]);
const tabs = Cast(sublists[0], Doc, null);
const other = Cast(sublists[1], Doc, null);
- const tabdocs = await DocListCastAsync(tabs.data);
- const otherdocs = await DocListCastAsync(other.data);
- Doc.GetProto(tabs).data = new List<Doc>(docs);
+ const tabdocs = await DocListCastAsync(tabs?.data);
+ const otherdocs = await DocListCastAsync(other?.data);
+ tabs && (Doc.GetProto(tabs).data = new List<Doc>(docs));
const otherSet = new Set<Doc>();
otherdocs?.filter(doc => !docs.includes(doc)).forEach(doc => otherSet.add(doc));
tabdocs?.filter(doc => !docs.includes(doc)).forEach(doc => otherSet.add(doc));
- Doc.GetProto(other).data = new List<Doc>(Array.from(otherSet.values()));
+ other && (Doc.GetProto(other).data = new List<Doc>(Array.from(otherSet.values())));
}, 0);
}
@@ -435,6 +435,8 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) {
}
}
-Scripting.addGlobal(function openOnRight(doc: any) { CollectionDockingView.AddSplit(doc, "right"); },
- "opens up the inputted document on the right side of the screen", "(doc: any)");
+Scripting.addGlobal(function openInLightbox(doc: any) { LightboxView.AddDocTab(doc, "lightbox"); },
+ "opens up document in a lightbox", "(doc: any)");
+Scripting.addGlobal(function openOnRight(doc: any) { return CollectionDockingView.AddSplit(doc, "right"); },
+ "opens up document in tab on right side of the screen", "(doc: any)");
Scripting.addGlobal(function useRightSplit(doc: any, shiftKey?: boolean) { CollectionDockingView.ReplaceTab(doc, "right", undefined, shiftKey); });